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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:09:18+00:00 2026-05-13T19:09:18+00:00

My Android app Transdroid offers several home screen widgets. Every AppWidget has 2 ‘buttons’

  • 0

My Android app Transdroid offers several home screen widgets. Every AppWidget has 2 ‘buttons’ (ImageButton), one starts the app and one starts some activity that refreshes the AppWidget content. Pretty simple. Here is a screenshot. The widget code is at my Google Code website, but most importantly:

RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.appwidget_15);
views.setOnClickPendingIntent(R.id.widget_action, PendingIntent.getActivity(context, 0, new Intent(context, Transdroid.class), 0));
appWidgetManager.updateAppWidget(id, views);

The problem is: the widget’s onUpdate is not called after the Home process is restarted, and hence the PendingIntents used to attach functionality to the buttons is lost.

It’s fairly easy to reproduce.

  1. Start an emulator
  2. Add a widget (that uses a PendingIntent to, say, start an activity)
  3. Click the button to see it actually works
  4. Force kill the home proces (‘adb -e shell kill 96’ where 96 is the PID of android.process.acore)
  5. The widget’s button doesn’t work any more.

More precise: no onReceive and thus no onUpdate is called when the android.process.acore Home process is restarted. In turn, no Intent is attached.

Anyone experienced the same problem and knows how to circumvent this problem?

  • 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-13T19:09:18+00:00Added an answer on May 13, 2026 at 7:09 pm

    I’ve just tested a couple of my own appwidgets, and their click events work fine after killing acore. Here’s my relevant code:

        final RemoteViews views = new RemoteViews(context.getPackageName(), layoutId);
        views.setOnClickPendingIntent(R.id.widget_view, PendingIntent.getActivity(
                context, 
                0, 
                new Intent(context, MyActivity.class).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK), 
                PendingIntent.FLAG_UPDATE_CURRENT));
    

    The major difference I can see is the intent-related flags; I’d say they are definitely worth trying. [The layoutId parameter in my code is set elsewere; this same code is used for several widgets with different layouts].

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

Sidebar

Related Questions

I'm trying to write test harness for part of my Android mapping application. I
I would like to update my SQL lite database with the native update-method of

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.