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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T08:38:57+00:00 2026-05-14T08:38:57+00:00

I have a widget on my home screen with several ImageButtons which have default

  • 0

I have a widget on my home screen with several ImageButtons which have default background images. Through the configuration activity, I can change the image on any of the ImageButtons. The problem is that when the screen is rotated, the image on the ImageButton disapears and it changes back to the default image.

I don’t know why this happens or how to fix it

  • 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-14T08:38:57+00:00Added an answer on May 14, 2026 at 8:38 am

    When the screen is rotated the entire appwidget is rebuilt using the last RemoteViews object you passed to AppWidgetManager.updateAppWidget(). Thus is it very important that every time you call updateAppWidget() you pass a RemoteViews object that has everything set on it that the widget needs if it were to be completely rebuilt, not just one or two things that you want to update on the widget display.

    So, in your AppWidgetProvider class, whenever you are updating your appwidget you need to create a RemoteViews object, build up all the view settings for your appwidget using that object, and then make one call to AppWidgetManager.updateAppWidget() when you are done.

    My guess is you are doing something like this:

    • Get RemoteViews Object
    • Set the new button image
    • Call updateAppWidget()
    • Get RemoteViews Object
    • Set a pending intent on the button
    • Call updateAppWidget()

    When you need to be doing something like this:

    • Get RemoteViews Object
    • Set the new button image
    • Set a pending intent on the button
    • Call updateAppWidget()
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a TextView in my home screen widget. Can I use the following
I have a widget that acts as a launcher on the home screen. How
I have a home-screen widget that has an icon that starts/so pose to bring
I have built a stackview widget for home Screen but i dont know how
I have a home screen widget with a button with a pendingIntent. Click it,
Possible Duplicate: Removing Widget from Home Screen when Uninstalled In Android, I have created
I have a use-case for a vertical 1x4 home screen widget on android. The
I have a widget that supposed to call an Activity of the main app
can a widget have a marquee textview? if so how would i implement it?
I have a problem with an appwidget. It doesn't have a configuration activity. When

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.