Clicking on a Widget stops working when the screen orienation is changed.


Last Updated:

  1. dodald

    dodald Member This Topic's Starter

    Joined:
    Nov 8, 2009
    Messages:
    18
    Likes Received:
    4
    I have a widget in an very simple app that I am wrote; it shows some information and is updated every couple of hours. Normally when the user clicks on the widget it brings up an Activity; but after the user changes the screen orientation or slides out the Keyboard they can no longer click on the widget. The only way to get the clicking working again is the delete and re-add the widget.

    The code I am using comes from this example: App Widgets | Android Developers

    Has anyone else ran into this?
     

    Advertisement
  2. dodald

    dodald Member This Topic's Starter

    Joined:
    Nov 8, 2009
    Messages:
    18
    Likes Received:
    4
    From:

    [android-developers] Re: Widget not working properly when changing orie

    Figure I would post what I found to be the solution here in case someone else stumbles on this problem:

    I was updating the Widget's view from a service because I was making a Web Service call, but I was adding the click handler from the onUpdate method.

    I was also updating the view from another place in my app. When I updated all of the updates to include the click handler it started working!
     

Share This Page

Loading...