Skip to content Skip to sidebar Skip to footer

Edittext Weird Behaviour In Listview Baseadapter

I got a ListView, populated using BaseAdapter. In the listview Item there's a numeric EditText: ...

Solution 1:

The implementation of EditText has many flaws when used in the ListView. Try to add this piece of code in your onCreate():

int apiVersion = android.os.Build.VERSION.SDK_INT;
if (apiVersion >= android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH)
            getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
else
            getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);

Solution 2:

You can try the following:

  • Check if you have another EditText that might be overlapped with the numeric one.
  • Create a new activity with only a numeric EditText and see if the same happens.
  • Check the activity's code to see if something is being modified on run time. I don't think you could change the EditText type via code, but maybe something else is modifying it's behavior.

Hope it helps debug the problem.

Post a Comment for "Edittext Weird Behaviour In Listview Baseadapter"