I have this main ListView (retrieved using this.getListView()
) in a ListActivity properly populated from a SQLite database. A click on one of its items (entries) calls another activity A2 using startActivityForResult()
. I would like to animate that SINGLE entry WHEN the user gets back to the ListActivity. (So I suppose I need to override the onActivityResult()
method)
How can I animate a single entry once the window gained focus and after the list is updated using notifyDataSetChanged()
?
I managed to animate the whole ListView using
getListView().setAnimation(anim)
and worked fine. However, when I do:
getListView().getChildAt(position).setAnimation(anim)
nothing happens.
EDIT: Here's my onActivityResult code
protected void onActivityResult(final int requestCode, final int resultCode, final Intent intent) {
super.onActivityResult(requestCode, resultCode, intent);
if(resultCode==RESULT_OK && requestCode==SOME_REQUEST_CODE){
Animation anim = new AlphaAnimation(1.0f,0.0f);
anim.setFillAfter(true);
anim.setDuration(400);
anim.setRepeatMode(Animation.REVERSE);
anim.setRepeatCount(7);
// Just for testing, I chose the first item of the ListView (position=0)
tr_adapter.getView(0, getListView().getChildAt(0), getListView()).setAnimation(anim);
tr_adapter.notifyDataSetChanged(); //Nothing happens
}
}