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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:44:47+00:00 2026-06-05T20:44:47+00:00

I have a Service that sends an Intent to my Activity every 0.1 seconds.

  • 0

I have a Service that sends an Intent to my Activity every 0.1 seconds. I use it to update a custom implementation of a Chronometer. Here everything goes right. The problem comes when I want to update 14 TextView I have in a TableView inside a Fragment in my Activity. Here the app is very slow.

The method in my Activity where it receives the Intent from the Service:

private BroadcastReceiver broadcastReceiver = new BroadcastReceiver() {
    @Override
    public void onReceive(Context context, Intent intent) {
        long milis = intent.getLongExtra("milis",0);
        if( mFragment != null)
        mFragment.Update(milis);
    }
};

The code inside the Fragment where I update the TextViews:

public void actualizarTiempoJuego(long milis){
    // Se recuperan los tiempos acumulados y se aumenta la cantidad pasada como parámetro
    for(int i=0;i<7;++i) {
        long mCurrentMilis1 = mVectorMilis1.get(i);
        long mCurrentMilis2 = mVectorMilis2.get(i);
        TextView1 t1 = mListaTitularLayoutLocal.get(i);
        TextView1 t2 = mListaTitularLayoutVisitante.get(i);
        t1.setText(String.value(milis + mCurrentMilis1));
        t2.setText(String.value(milis + mCurrentMilis2));
    }
}

Am I doing anything wrong, or is it just that I’m trying to do something very complex in terms of efficiency?

  • 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-06-05T20:44:49+00:00Added an answer on June 5, 2026 at 8:44 pm

    @Sherif brings up a good point about hidden alpha values that bog down your application a lot.
    Depending on your platform you may also want to check

    <application android:hardwareAccelerated="true"... />
    

    Another thing you can look into that may help performance is not firing off all those Intents. Once you start firing intents you are getting the system involved and depending on how they are getting resolved it may take some extra time.

    For this issue I like to use Handlers. They are more light weight than intent.
    You may also want to look at AsyncTask. This is basically like a thread, but also gives hooks that run on the UI Thread so you can perform both perform a background operation and update the UI without have to post runnables.

    EDIT: Lastly, you can always run your layouts through the layoutopt tool. I was personally told by Romain Guy himself that if your drawing too slow, than you need to draw less. Just check out a screenshot (from a less than ideal view tree, but well within the max) from the profiling tool. You can see how much of the resources view drawing takes up. It’s very important to keep this as lean as possible if you want your app to be responsive.
    Profiling View Drawing Resource Consumption

    EDIT: It is no longer called layoutopt, it’s called lint. Check your ~/android-sdk/tools/

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

Sidebar

Related Questions

I have a service that needs to update the registry every 5 minutes (counteract
Situation: I have a Service (also have tried using an Activity ) that sends
I have a few intents that activity sends to service. All of those are
We have an external service that continuously sends us data. For the sake of
Lets say that i have 2 pages: index.php and service.php index.php sends an http-post
I have a service that use the tcp binding and this services allows to
I have a service that has a dependency on SQL server express (2005). Every
I have a service that synchronize data every minute. When a data is modified/created,
I have a service B that sends a specific number of messages in a
I have a Networking service that i want to use as a Service. It's

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.