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

  • Home
  • SEARCH
  • 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 6951361
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:12:36+00:00 2026-05-27T14:12:36+00:00

I have an application widget that contains a button. Once I click the button,

  • 0

I have an application widget that contains a button. Once I click the button, it takes the activity a while to load. In the activity that’s loaded, I have two asynch tasks that take a few seconds to execute. So, what I’d like to do is launch a progress dialog page while the activity is loading.

Since the widget icon is set up as an intent in onUpdate:

public class MyWidget extends AppWidgetProvider {

    @Override
    public void onEnabled(Context context) {
        super.onEnabled(context);
    }

    @Override
    public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
         remoteViews = new RemoteViews(context.getPackageName(), R.layout.main);    
         Intent messageIntent = new Intent(context, MyActivity.class);
         messageIntent.setAction(ACTION_WIDGET_GROUP);
    }
}

There is no specific “onClick” to initialize the progress dialog. In addition, I’m not inside of the activity yet, I’m launching the activity from the widget.

How and where do I set up a progress dialog in the widget for this to work? Does the progress dialog belong in the application widget?

The progress dialog doesn’t launch within the activity itself. Well it does, but it only starts after the activity loads:

public class HomeActivity extends Activity {

protected void onCreate(Bundle savedInstanceState) 
{
    super.onCreate(savedInstanceState);
    setContentView(R.layout.dashboard);
    setupLayout();   
    callAsynchronousUsers(); // asynchronous call
        getData(); // asynchronous call
    }

. . .
}

Any and all help is appreciated.

  • 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-27T14:12:36+00:00Added an answer on May 27, 2026 at 2:12 pm

    Well, you can’t do that, the only way would be to launch a transparent activity in the middle that shows only a custom dialog with a progress bar and then launches the real activity. But is not an elegant solution, actually it sucks.

    What I suggest is to open your activity right away and showing the progress bar there based on your AsyncTask, I think it is the standard way to do it. That’s what AsyncTask is for, you can execute hard work indipendently from the UI, in your case you would show a progress bar with a message.

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

Sidebar

Related Questions

I have an application that contains more widgets - a QGRaphicsView widget and 2
In a C# desktop application, I have a customer widget which contains a text
I have a start page on my application that is just a QWebView widget
In my application I have an activity which contains a viewflipper with 3 listviews
There is application that handles text commands. I have a Qt widget that is
I am working on an application with two children. One's a widget that functions
I have a portal application that loads external content (widgets) via an iframe. Users
I have application that makes different queries with different results so the caching in
I have application that is connecting to the DB and if I enter incorrect
I have application that is up more than 3 days. I can see in

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.