Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here is the sample which you are expecting. In this example list view images are get loaded from server urls(From Service Dynamically)</p> <p>have a look at this. <a href="http://www.androidhive.info/2012/02/android-custom-listview-with-image-and-text/" rel="nofollow">http://www.androidhive.info/2012/02/android-custom-listview-with-image-and-text/</a> hope this helps you. </p> <p><strong>EDIT</strong> Here is the code which you want.</p> <pre><code>package com.sample.view; import java.util.Timer; import java.util.TimerTask; import android.app.Activity; import android.os.Bundle; import android.os.Handler; import android.util.Log; import android.view.View; import android.view.animation.Animation; import android.view.animation.AnimationUtils; import android.widget.Button; import android.widget.ImageView; public class Test3 extends Activity { ImageView imageview1; Button button1; @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.main2); imageview1=(ImageView)findViewById(R.id.imageView1); mHandler = new Handler(); imageview1.setVisibility(View.VISIBLE); startPlay(); } int mThumbIds[]={R.drawable.ic_launcher,R.drawable.home,R.drawable.green }; int i =0; private Handler mHandler; private void startPlay(){ final Timer timer = new Timer(); timer.scheduleAtFixedRate(new TimerTask() { public void run() { Log.i("Test", "Sample= " +i); play(i); if(i==2){ timer.cancel(); startPlay(); //for continuous play. infinite play i=0;// resetting the values } else{ i++; } } }, 1800, 1800); // here is the duration whcih you want to change the images. } private void play(final int round){ mHandler.post(new Runnable(){ public void run(){ imageview1.setImageResource(mThumbIds[round]); Animation hyperspaceJump1 = AnimationUtils.loadAnimation(Test3.this,android.R.anim.fade_in); imageview1.startAnimation(hyperspaceJump1); } }); } } </code></pre>
    singulars
    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.
 

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