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

  • SEARCH
  • Home
  • 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 3698982
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T05:02:51+00:00 2026-05-19T05:02:51+00:00

I have a listview with different layouts for all the listitems. My first listitem

  • 0

I have a listview with different layouts for all the listitems. My first listitem contains an edittext. Whenever I click on this, keyboard shows up. But this keyboard displaces all the listitems in the listview. Whenever I click that edittext, the items change their positions. I’m really confused about this.

This is my code:

 public View getView(int position, View convertView, ViewGroup parent) {

         ViewHolder holder;
         if (convertView == null) {
             if(position == 0)
             {
                 convertView = mInflater.inflate(R.layout.remindertitle, null); 
                 edttxtForTitle = (EditText) convertView.findViewById(R.id.edittext);
                 convertView.setMinimumHeight(60);
             }

             else if(position == 1)
             {
                 convertView = mInflater.inflate(R.layout.reminderfrom, null);    
                 TextView txtTitle = (TextView) convertView.findViewById(R.id.txtvwFrom);
                 txtTitle.setText("From");
                 mPickDate = (Button) convertView.findViewById(R.id.btnDate);
                 mPickDate.setText(
                            new StringBuilder()
                                    // Month is 0 based so add 1
                                    .append(mDays[mDay].substring(0, 3)).append(", ")
                                    .append(mDay).append(" ")
                                    .append(mMonths[mMonth]).append(" ")
                                    .append(mYear).append(" "));
                 mPickDate.setOnClickListener(new View.OnClickListener() {
                        public void onClick(View v) {
                            settingValueForFromOrTo = true;
                            showDialog(DATE_DIALOG_ID);
                        }
                    });

                 strDateFrom = new StringBuilder()
                 // Month is 0 based so add 1
                .append(mDays[mDay].substring(0, 3)).append(", ")
                .append(mDay).append(" ")
                 .append(mMonths[mMonth]).append(" ")
                 .append(mYear).append(" ");

                 mPickTime = (Button) convertView.findViewById(R.id.btnTime);
                 mPickTime.setText(
                         new StringBuilder()
                            .append(pad(mHour)).append(":")
                            .append(pad(mMinute)));
                 mPickTime.setOnClickListener(new View.OnClickListener() {
                        public void onClick(View v) {
                            settingValueForFromOrTo = true;
                            showDialog(TIME_DIALOG_ID);
                        }
                    });
                 strTimeFrom = new StringBuilder()
                .append(pad(mHour)).append(":")
                .append(pad(mMinute));
             }

             else if(position == 2)
             {
                 convertView = mInflater.inflate(R.layout.reminderto, null);    
                 TextView txtTitle = (TextView) convertView.findViewById(R.id.txtvwTo);
                 txtTitle.setText("To");
                 mPickDateForFinalDate = (Button) convertView.findViewById(R.id.btnDatefinal);
                 mPickDateForFinalDate.setText(
                            new StringBuilder()
                                    // Month is 0 based so add 1
                                    .append(mDays[mfinalDay].substring(0, 3)).append(", ")
                                    .append(mfinalDay).append(" ")
                                    .append(mMonths[mfinalMonth]).append(" ")
                                    .append(mfinalYear).append(" "));
                 mPickDateForFinalDate.setOnClickListener(new View.OnClickListener() {
                        public void onClick(View v) {
                            settingValueForFromOrTo = false;
                            showDialog(DATE_DIALOG_ID_FINAL);
                        }
                    });

                 strDateFrom = new StringBuilder()
                 // Month is 0 based so add 1
                .append(mDays[mfinalDay].substring(0, 3)).append(", ")
                .append(mfinalDay).append(" ")
                 .append(mMonths[mfinalMonth]).append(" ")
                 .append(mfinalYear).append(" ");

                 mPickTimeForFinalTime = (Button) convertView.findViewById(R.id.btnTimefinal);
                 mPickTimeForFinalTime.setText(
                         new StringBuilder()
                            .append(pad(mfinalHour)).append(":")
                            .append(pad(mfinalMinute)));
                 mPickTimeForFinalTime.setOnClickListener(new View.OnClickListener() {
                        public void onClick(View v) {
                            settingValueForFromOrTo = false;
                            showDialog(TIME_DIALOG_ID_FINAL);
                        }
                    });
                 strTimeFrom = new StringBuilder()
                .append(pad(mfinalHour)).append(":")
                .append(pad(mfinalMinute));
                 }

             else if(position == 3)
             {
                 convertView = mInflater.inflate(R.layout.allday, null);   

                 convertView.setMinimumHeight(60);
             }

             else if(position == 4)
             {
                 convertView = mInflater.inflate(R.layout.alarm, null);
                 txtAlarm = (TextView) convertView.findViewById(R.id.txtAlarmValue);
                 convertView.setMinimumHeight(60);
             }

             else if(position == 5)
             {
                 convertView = mInflater.inflate(R.layout.repeat_view, null);  
                 txtRepeat = (TextView)convertView.findViewById(R.id.txtRepeatValue);
                 convertView.setMinimumHeight(60);
             }

             else if(position == 6)
             {
                 convertView = mInflater.inflate(R.layout.submitbutton_view, null);  
                 Button btnSubmit = (Button)convertView.findViewById(R.id.btnSubmit);
                 btnSubmit.setOnClickListener(new View.OnClickListener() {
                        public void onClick(View v) {
                            String title = edttxtForTitle.getText().toString();

                            Log.v("","all the values title" + title);
                            Log.v("","all the values datefrom" + strDateFrom.toString());
                            Log.v("","all the values dateto" + strDateTo.toString());
                            Log.v("","all the values timefrom" + strTimeFrom.toString());
                            Log.v("","all the values timeto" + strTimeTo.toString());
                            Log.v("","all the values allday" + allDay);
                            Log.v("","all the values alarm" + strAlarm);
                            Log.v("","all the values repeat" + strRepeat);

                        }
                    });
                 convertView.setMinimumHeight(60);
             }

             holder = new ViewHolder();      
             holder.btnFromDate = (Button) convertView.findViewById(R.id.btnDate);
             holder.btnFromTime = (Button) convertView.findViewById(R.id.btnTime);
             holder.txtLabelTitle = (TextView) convertView.findViewById(R.id.txtvwFrom);
             holder.btnFromDatefinal = (Button) convertView.findViewById(R.id.btnDatefinal);
             holder.btnFromTimefinal = (Button) convertView.findViewById(R.id.btnTimefinal);
             holder.txtLabelTitlefinal = (TextView) convertView.findViewById(R.id.txtvwTo);

             convertView.setTag(holder);    

         } else {
             holder = (ViewHolder) convertView.getTag();
         }

         return convertView;
     }

      class ViewHolder {
         Button btnFromDate; 
         Button btnFromTime; 
         TextView txtLabelTitle;
         Button btnFromDatefinal; 
         Button btnFromTimefinal; 
         TextView txtLabelTitlefinal;
       }

Am I messing around with LayoutInflator?

  • 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-05-19T05:02:52+00:00Added an answer on May 19, 2026 at 5:02 am

    You can use this code for that.

    You have to add android.manifest.xml file below code:

    android:windowSoftInputMode="adjustPan"

    For your purpose you can also set other properties there.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a ListView with different layouts for different items. Some items are separators.
I'm completely stumped on this one. I have three different lists that need to
I have a ListView that contains two types of objects, single and multiple. The
I have a ListView , which is in single-choice mode . All I want
I have a ListView that uses different XML files to create Views and make
I have a ListView control, and I'm trying to figure out the easiest/best way
I have a ListView which sometimes I need to put around 10000 items in.
I have a ListView in WPF that is databound to a basic table that
I have a ListView containing file names. These file names need to be draggable
I have a ListView on a page that displays a list of widgets. When

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.