0

So in my ListView I have 4 different views I inflate, and one of them takes user input with a simple AlertDialog EditText and then saves it to a TextView. The problem I'm running into is when the user clicks on the editText and has the keyboard pop-up for them to type, it switches all my views in my listView. I'm thinking it rearranges them because the keyboard is taking up half the screen... but I honestly have NO idea. This only happens when I test my app on my droid razr. If I test on my nexus 7, I have no problem because the keyboard doesn't take up as much room of the screen.

I'll post a picture from my nexus 7 because I can't take a SS with my razr.

This is pre-keyboard pop-upenter image description here

This is post-keyboard popup

enter image description here

They don't look so different since it's on the nexus 7 with a 10 inch screen, but when I test this on my razr....my headers/views all switch around It's like android goes ahead and recycles them. Is there any way to stop this..? To keep the listView views as they are?

cj1098
  • 1,560
  • 6
  • 32
  • 60
  • Using a edittext and listview is very volatile :). Since there are only 4 you can use a simple layout. As there is hardly any view reuse which you are using. – Jayshil Dave Jun 17 '13 at 14:04

2 Answers2

2

Add this line in your AndroidManifest.xml inside your specific activity tag

<activity android:name="com.packagename.activities" 
            android:windowSoftInputMode="adjustNothing"></activity>

For more reference please see this link

Hope it will help you :)

Community
  • 1
  • 1
1

add this in your manifest with the activity

Example

    <activity android:name="YourActivity" >
     android:windowSoftInputMode="stateVisible|stateUnchanged"
    </activity>
anddevmanu
  • 1,459
  • 14
  • 19