Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7571045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T15:34:27+00:00 2026-05-30T15:34:27+00:00

I am making an application for android which should show pictures (i was already

  • 0

I am making an application for android which should show pictures (i was already obtained), only now the app ah changed course and the images should be displayed at varying intervals, for example, the first image is displayed when starting the activity, the second after 4 seconds, the third after 15 seconds, etc … this is my activity that shows the images within fixed intervals;

public class WCourse extends Activity implements OnClickListener, OnTouchListener, OnCompletionListener, OnBufferingUpdateListener{

//player
private ImageButton buttonPlayPause;
private SeekBar seekBarProgress;
public EditText editTextSongURL;


public static TextView TextViewTopTitle;

//Slider
public int currentimageindex=0;
Timer timer;
TimerTask task;
ImageView slidingimage;

//images ids
private int[] IMAGE_IDS = {
        R.drawable.c5_d1, R.drawable.c5_d2, R.drawable.c5_d3, R.drawable.c5_d4, R.drawable.c5_d5,
        R.drawable.c5_d6, R.drawable.c5_d7, R.drawable.c5_d8, R.drawable.c5_d9, R.drawable.c5_d10,
        R.drawable.c5_d11, R.drawable.c5_d12, R.drawable.c5_d13, R.drawable.c5_d14, R.drawable.c5_d15,
        R.drawable.c5_d16, R.drawable.c5_d17, R.drawable.c5_d18, R.drawable.c5_d19, R.drawable.c5_d20,
        R.drawable.c5_d21, R.drawable.c5_d22, R.drawable.c5_d23, R.drawable.c5_d24, R.drawable.c5_d25,
        R.drawable.c5_d26, R.drawable.c5_d27, R.drawable.c5_d28, R.drawable.c5_d29, R.drawable.c5_d30,
        R.drawable.c5_d31, R.drawable.c5_d32, R.drawable.c5_d33, R.drawable.c5_d34, R.drawable.c5_d35,
        R.drawable.c5_d36, R.drawable.c5_d37, R.drawable.c5_d38, R.drawable.c5_d39, R.drawable.c5_d40,
        R.drawable.c5_d41, R.drawable.c5_d42, R.drawable.c5_d43, R.drawable.c5_d44, R.drawable.c5_d45,
        R.drawable.c5_d46
    };

//player    
private MediaPlayer mediaPlayer;
private int mediaFileLengthInMilliseconds; // this value contains the song duration in milliseconds. Look at getDuration() method in MediaPlayer class

//slider handler
private final Handler handler = new Handler();

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.watch_course);

    TextViewTopTitle = (TextView) findViewById(R.id.TextViewTopTitle);
    Bundle bundle = getIntent().getExtras();
    TextViewTopTitle.setText(bundle.getString("RESULT2")+" ");
    getText(bundle.getString("RESULT2"));

    final Handler mHandler = new Handler();    
    initView();

 // Create runnable for posting
    final Runnable mUpdateResults = new Runnable() {
        public void run() {

            AnimateandSlideShow();

        }
    };

    final int delay = 500; // delay for .5 sec.      

    final long period = 1000;        
    Timer timer = new Timer();

    timer.scheduleAtFixedRate(new TimerTask() {

    public void run() {         
         mHandler.post(mUpdateResults);
    }

}, delay, period);}

private void AnimateandSlideShow() {
slidingimage = (ImageView)findViewById(R.id.ImageView3_Left);
    slidingimage.setImageResource(IMAGE_IDS[currentimageindex%IMAGE_IDS.length]);
currentimageindex++;
    slidingimage.getAnimation();}

Any suggestions or examples of how to display these images at varying intervals? really would appreciate your help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T15:34:29+00:00Added an answer on May 30, 2026 at 3:34 pm

    Use below code hope it will help

    MyCount count=new MyCount(IMAGE_IDS.length * 1000,1000);  
     public class MyCount extends CountDownTimer{
    
                public MyCount(long millisInFuture, long countDownInterval) {
                   super(millisInFuture, countDownInterval);
                   }
    
                   @Override
                   public void onFinish() {
                          start=0;
                      count.start();
                      }
    
                   @Override
                   public void onTick(long millisUntilFinished) {
                          if(start<=IMAGE_IDS.length)
    {
                       img.setImageResource(IMAGE_IDS[start])
                       start+=1;
    }
    
                     }
            }
    int start=0;
    count.start();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am making an android application in which I have put 10 images and
I'm making an android application in which I want to show Punjabi text in
I am making an application (iPhone app) which gets information (jokes) from an RSS
I am making an android application in which i have five items in a
I am making an small application in android in which i used an image
I am an android developer.I am making an application in which I have to
Friends i am making an application in which i am using Map Activity. Now
Im making a client application for my ZTE Blade Android phone, which receives a
I m making an application in ANDROID which will be used at two ends.
im making an android application which requires a user to register using a form

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.