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 6917597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:45:02+00:00 2026-05-27T09:45:02+00:00

Somehow it doesn’t work, according to me it should be this: public void Splash(){

  • 0

Somehow it doesn’t work, according to me it should be this:

public void Splash(){
    Timer timer= new Timer();

    timer.schedule(new TimerTask(){ 

    MexGame.this.runOnUiThread(new Runnable() {

      public void run(){
      SplashImage.setImageDrawable(aktieknop);
      } //Closes run()

      }); //Closes runOnUiThread((){})

  },SplashTime); //Closes the Timeratask((){})

} //closes Splash()

Anybody any idea where I’m missing something?

FORMAL COMMENT
I know silly issue, or maybe I’m doing something impossible, but I tried all the logical possibilities. So probably missing something or I’m trying to do something that is not possible.
Can you please help me out.
I’m trying to use the following code, but that gives token issues:

 Timer timer= new Timer();
   timer.schedule(new TimerTask(){

     runOnUiThread(new Runnable() {

      public void run(){
      SplashImage.setImageDrawable(aktieknop);}

      });}

  },SplashTime);

If I block out the runOnUiThread it crashes since I’m trying to adapt the UI from another thread, but at least no token issue, anybody any idea?:

   Timer timer= new Timer();


  timer.schedule(new TimerTask(){

//   runOnUiThread(new Runnable() {

      public void run(){
      SplashImage.setImageDrawable(aktieknop);}

    //  });}

  },SplashTime);
  • 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-27T09:45:02+00:00Added an answer on May 27, 2026 at 9:45 am

    Both the TimerTask and the Runnable require you to implement a run method, so you’ll need two run methods.

    Also your code will be more easy to read if you separate the construction of the Runnable from the construction of the TimerTask.

       final Runnable setImageRunnable = new Runnable() {
            public void run() {
                 splashImage.setImageDrawable(aktieknop);
            }
        };
    
        TimerTask task = new TimerTask(){
            public void run() {
                getActivity().runOnUiThread(setImageRunnable);
            }
        };
    
        Timer timer = new Timer();
        timer.schedule(task, splashTime);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Somehow this doesn't work on my server $query = new WP_Query( array ( 'orderby'
somehow this doesn't work: if(direction != 'leftnav') direction = 'leftnav'; if(direction == 'leftnav') direction
How do i repeat this, somehow the clear doesn't make the layout under eachother
I am using this class to load multiple images synchronously. Somehow the loader doesn't
I'm trying to use dateFromString method from NSDateFormatter but it somehow doesn't work for
I am using this guide for integrating wicked_pdf on heroku. But somehow it doesn't
documentDOM.addEventListener(click, new EventListener() { public void handleEvent(Event evt) { if (evt.getType().equals(click)) { System.out.println(hello); MouseEvent
I'm trying to validate my php form using exception, but somehow it doesn't work.
There are plugins for handling history and bookmarking like: http://plugins.jquery.com/project/history . Somehow it doesn't
Is it possible to somehow do this without taking out the @? It does

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.