Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I animate one single item (entry) after the List is already updated and drawn?
    primarykey
    data
    text
    <p>I have this main ListView (retrieved using <code>this.getListView()</code>) in a ListActivity properly populated from a SQLite database. A click on one of its items (entries) calls another activity A2 using <code>startActivityForResult()</code>. I would like to animate that SINGLE entry WHEN the user gets back to the ListActivity. (So I suppose I need to override the <code>onActivityResult()</code> method)</p> <p>How can I animate a single entry once the window gained focus and after the list is updated using <code>notifyDataSetChanged()</code>? </p> <p>I managed to animate the whole ListView using</p> <pre><code>getListView().setAnimation(anim) </code></pre> <p>and worked fine. However, when I do:</p> <pre><code>getListView().getChildAt(position).setAnimation(anim) </code></pre> <p>nothing happens.</p> <p><strong>EDIT</strong>: Here's my onActivityResult code</p> <pre><code>protected void onActivityResult(final int requestCode, final int resultCode, final Intent intent) { super.onActivityResult(requestCode, resultCode, intent); if(resultCode==RESULT_OK &amp;&amp; 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 } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload