Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9248653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:59:31+00:00 2026-06-18T09:59:31+00:00

Background I have the next layout of my activity: vertical LinearLayout TabHost with a

  • 0

Background

I have the next layout of my activity:

  • vertical LinearLayout
    • TabHost with a viewPager.
    • “status bar” (an imageView/textView) .

Sometimes , in the viewPager , i have a fragment that has an EditText.

The problem

On some screens (like the galaxy mini) , i’ve noticed that when you click on an editText (in order to write into it) , the softkeyboard hides everything , so you are left only with the actionBar , the tabs and the status bar .

What I’ve tried

That’s why i’ve decided to add the next flags on the manifest for this activity :

android:windowSoftInputMode="adjustPan|adjustResize|stateHidden"

This looked like the perfect solution – it hides the action bar , the tabs , and even the status bar when typing , leaving enough space for the editText to show (and also scrolls to it) .

However , testing it on larger screens (like the one of galaxy S3) , this has caused the softKeyboard to cover the editText in the cases where the editText was at the bottom.

I’ve tried to remove the adjustPan flag , which works fine for the large screen , but then on the small screen , even though it has scrolled to the editText , the status bar hides it .

I’ve also tried to set the isScrollContainer to true to some views , hoping that it will cause them to resize upon editing , but it didn’t do anything.

The question

What can i do in order to fix this issue , and handle all kinds of screens ?

I could check the type of the screen and use the appropriate flags programmatically (like here) , but i’m not sure what should be the rules (density/resolution/screen size) , and if i really cover all types of them .

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T09:59:32+00:00Added an answer on June 18, 2026 at 9:59 am

    try android:windowSoftInputMode="adjustPan

    with additional functionality

    Make another class like this one

    package com.example.customLayout;
    
    import android.content.Context;
    import android.util.AttributeSet;
    import android.widget.RelativeLayout;
    
    public class MyRelativeLayout extends RelativeLayout
    {
        private OnRelativeLayoutChangeListener layoutChangeListener;
    
        public interface OnRelativeLayoutChangeListener 
        {
            void onLayoutPushUp();
            void onLayoutPushDown();
        }
    
        public MyRelativeLayout(Context context, AttributeSet attributeSet) 
        {
            super(context, attributeSet);
        }
    
        @Override
        protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) 
        {
            try 
            {
                final int proposedheight = MeasureSpec.getSize(heightMeasureSpec);
                final int actualHeight = getHeight();
                if (actualHeight > proposedheight)
                {
                    // Keyboard is shown
                    layoutChangeListener.onLayoutPushUp();
                }
                else if(actualHeight < proposedheight)
                {
                    // Keyboard is hidden
                    layoutChangeListener.onLayoutPushDown();
                }
            } 
            catch (Exception e) 
            {
                e.printStackTrace();
            }   
    
            super.onMeasure(widthMeasureSpec, heightMeasureSpec);
        }
    
        public void setLayoutChangeListener(OnRelativeLayoutChangeListener layoutChangeListener) 
        {
            this.layoutChangeListener = layoutChangeListener;
        }
    
        public OnRelativeLayoutChangeListener getLayoutChangeListener() 
        {
            return layoutChangeListener;
        }
    }
    

    now make a custome view of this class as parent in your layout xml file like this

    <com.example.customLayout.MyRelativeLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:custom="http://schemas.android.com/apk/res/com.example.customLayout"
    
        android:id="@+id/customRelativeLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
    
    
    // your original layout file
    
    </com.example.customLayout.MyRelativeLayout>
    

    try following code in your java file

    myRelativeLayout=(MyRelativeLayout)findViewById(R.int.customRelativeLayout);

     myRelativeLayout.setLayoutChangeListener(new OnRelativeLayoutChangeListener() {
    
                    public void onLayoutPushUp() 
                    {
                        Controller_Test1.tabWidget.setVisibility(View.GONE);    
                    }
    
                    public void onLayoutPushDown() 
                    {
                        Controller_Test1.tabWidget.setVisibility(View.VISIBLE);
                    }
                });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a vertical LinearLayout and TextView. File: unitdetails.xml <LinearLayout android:id=@+id/unit_details_person android:layout_width=match_parent android:layout_height=wrap_content android:layout_below=@id/unit_person_header
I have a LinearLayout that I would like to change the background color of
I have a horizontal navigation bar. Each button is a span with a background
Currently I have following layout: <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:id=@+id/editorRootView android:layout_width=fill_parent android:layout_height=fill_parent android:orientation=vertical > <RelativeLayout android:id=RL1
I have next view hiererchy: <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent android:layout_height=wrap_content android:paddingLeft=10dp android:paddingRight=10dp android:gravity=center> <LinearLayout android:layout_width=fill_parent
I have a horizontal LinearLayout. This LinearLayout has a checkbox next to another LinearLayout.
I have a layout which has an adview under an imageview.In some conditions i
I have a Relative Layout with multiple TextView's inside. This layout has wrap_content on
Background: I have an MVC based polaroid object. The model keeps the photo's metadata,
Background I have an array of objects (Users) defined and set as follows: //

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.