How to create an app widget with a configuration activity, and update it for the first time?

前端 未结 4 735
自闭症患者
自闭症患者 2020-12-12 22:42

This is driving me crazy. I don\'t know how to update the app widget from the configuration activity, even with the recommended practises. Why the update method is not calle

4条回答
  •  醉话见心
    2020-12-12 23:22

    I didn't see your appwidgetprovider.xml and AndroidManifest.xml, but my guess is that you didn't set up your configuration activity properly.

    Here's how to do it:

    1. add the following attribute to your appwidgetprovider.xml:

      
      
    2. Your configuration activity should have an appropriate intent-filter:

      
          
              
          
      
      

    If configuration activity is configured correctly, onUpdate() is only triggered after it finishes.

提交回复
热议问题