I have a ListView with an adapter. After removing an item and calling adapter.notifyDataSetChanged() I need to perform some calculations using the method: list.getFirstVisiblePosition().
I have a ListView with a onListItemListener, I have it so if you tap a ListView Item it removes it, but for some reason if I remove the last item form the list, the app crashes and gives me this error (java.lang.IndexOutOfBoundsException: Invalid index 3, size is 3)
Does anyone have any idea what that means?
This is my code:
@Override
protected void onListItemClick(ListView l, Vie
I have a class which is under a test with Robotium, in it's onPause() method I just clear the EditText (I don't need the data to be preserved after onPause()).
So I have in a class which is under a test:
@Override
protected void onPause() {
super.onPause();
mEdtPassword.setText("");
}
and testing method:
public void testOnPauseOnStart() {
Activity mActivity = getActivity();
I'm having problem with an AsyncTask in my app. I load some dat in doInBackground(), and with that data (contains a link to download an image) I fill a ListView. My idea was to fill the ListView in onPostExecute(), but I can't because the adapter uses a Http connection to download the image and show it.
It was perfectly fine to update just a TextView, but when I tried to update a ListView from onReceive, I kept getting NullPointerException from getView method (BaseAdapter). I have tried
both
handler.post & runOnUiThread but the problem remains the same.
I'm pretty new to programming, and as you'll probably notice even newer to android programming. I just want my view to be updated at regular intervals so that I can have moving objects, but doing this has been nothing but agony- and no matter what I do I just can't get around the error "Only the original thread that created a view hierarchy can touch its views".
i wrote this code inorder to handle the onScroll method (when i reach to the bottom of the listView it will load one more item to the listView this is my function in the onCreate mothod:
private int count=0;
private int step=1;
count=0;
Log.d("main ","before add more"+count);
addMore();
Log.d("main ","after add more"+count);
swipeListView.setOnScrollListe
I'm extending a CursorAdapter to bind data to views in a ListView. When the subview within the item has an onClick listener, onItemClick is not called for the row. I want subview's onClick method called, AND the onItemClick method called, AND the row to highlight when touched (as it does by default when the subview does not have an onClickListener attached).
No, it's not a duplicate.
I have a ListView (not the View in a layout xml file, the View as class) and want to display a view for the empty state.
The addView method isn't available, simple replacing the ListView doesn't work, because the parent is a ViewPager.
Any ideas?