Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>In may app i am giving choice to user to select cap,scarf among different options based on the user selection i need to animate that cahrecter with user selcted cap and scarf</p> <pre><code> //Iam posting the some sample code here public int maledance[]={R.drawable.char01,R.drawable.char02,R.drawable.char03,R.drawable.char04,R.drawable.char05,R.drawable.char06 ,R.drawable.char07,R.drawable.char08,R.drawable.char09,R.drawable.char10,R.drawable.char11,R.drawable.char12,R.drawable.char13,R.drawable.char14,R.drawable.char15}; public int maledancescarf1[]={R.drawable.scarve101,R.drawable.scarve102,R.drawable.scarve103,R.drawable.scarve104,R.drawable.scarve105,R.drawable.scarve106, R.drawable.scarve107,R.drawable.scarve108,R.drawable.scarve109,R.drawable.scarve110,R.drawable.scarve111,R.drawable.scarve112,R.drawable.scarve113,R.drawable.scarve114,R.drawable.scarve115}; </code></pre> <p>etc......</p> <pre><code> charecteranimation=new AnimationDrawable(); capanimation=new AnimationDrawable(); capboarderanimation=new AnimationDrawable(); scarfmainanimaiton=new AnimationDrawable(); scarfboarderanimation=new AnimationDrawable(); faceexpressionanimation=new AnimationDrawable(); for(int i=0;i&lt;maledance.length;i++) { Log.i("fani","string lenth is "+maledance.length+" delay is "+delay); charecteranimation.addFrame(getResources().getDrawable(maledance[i]),t); capanimation.addFrame(getResources().getDrawable(maledancecap[i]),t); scarfmainanimaiton.addFrame(getResources().getDrawable(maledancescarf[i]),t); faceexpressionanimation.addFrame(getResources().getDrawable(malefaceexpression[i]),t); } capanimation.setOneShot(false); charecteranimation.setOneShot(false); scarfmainanimaiton.setOneShot(false); faceexpressionanimation.setOneShot(false); //in onwindowfocuschanged listner i am starting the animations </code></pre>
 

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