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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:06:48+00:00 2026-05-27T11:06:48+00:00

I am creating the following thread in my onCreate but realized that this call

  • 0

I am creating the following thread in my onCreate but realized that this call needs to execute every 20 minutes or so:

 Thread t = new Thread() {
    public void run(){
       setTopUsers();
    }
  };

  t.start();

 private void setTopUsers() {
    ...

    for(Map.Entry<Double,String> entry : myMap.entrySet()) {
           key = entry.getKey();
           value = entry.getValue();

           if(...)
              view.setText(...)
       }
}

The method that’s being called simply processes information from a TreeMap and displays the results to the UI. I’m trying to figure out what is the best way to handle this: 1) Create a Timer that runs on a separate thread (but I’ve read that’s not a good idea), 2) Create a service Intent that processes every 20 minutes (seems like overkill).

Any suggestions?

  • 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-27T11:06:48+00:00Added an answer on May 27, 2026 at 11:06 am

    http://developer.android.com/reference/android/app/AlarmManager.html#setRepeating%28int,%20long,%20long,%20android.app.PendingIntent%29

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating an array of Thread::Queue elements. I'm doing that like this: for (my
I trying to execute the following code... but the AlertDialog is creating problems! Without
I'm creating JPopUpMenu with following code: JPopupMenu popup1 = new JPopupMenu(); JPopupMenu popup2 =
Take the following example: public void init() { final Environment env = new Environment();
Apologies for creating a new thread. I was not able to frame the question
I am creating an auto-complete control that updates as the user types text. Every
I am creating a new thread in c using _beginthreadex. I have written the
I have used the following code to create a new thread: [NSThread detachNewThreadSelector:@selector(backgroundMethod:) toTarget:self
In this article: http://msdn.microsoft.com/en-us/library/ms171728(VS.80).aspx The author uses the following method to make thread-safe calls
i creating for stopwatch with start,stop i use following code it started but not

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.