1. Check out our companion app, Forums for Android! Download from Google Play

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

Discussion in 'Application Development' started by dodald, Nov 15, 2009.

  1. dodald

    dodald Member
    Thread Starter
    16

    Nov 8, 2009
    18
    4
    16
    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
    Thread Starter
    16

    Nov 8, 2009
    18
    4
    16
    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...