android studio里注册中action的name是怎么对应的
阿神
阿神 2017-04-17 15:49:24
0
2
575

<receiver android:name=".MusicWidget">

        <intent-filter>
            <action android:name="android.appwidget.action.APPWIDGET_UPDATE"/>
        </intent-filter>
        <meta-data android:name="android.appwidget.provider"
                   android:resource="@layout/widget_setting">

        </meta-data>
        

android:name 后面的是怎么确定的?怎么跟widget对应起来的?

阿神
阿神

闭关修行中......

reply all(2)
迷茫

There are two types of actions, one is system level action and the other is application custom action. For widgets, to implement widget updates, you must filter and monitor the android.appwidget.action.APPWIDGET_UPDATE action. This is a system-level action defined and managed by AppWidgetManger. The system Framework layer AppWidgetService is responsible for the widget's broadcast update support. , and finally the application layer AppWidgetProvider (derived from BroadcastReceiver) receives this action and processes it.

黄舟

This name needs to specify a Receiver subclass or AppWidgetProvider subclass. When the widget corresponding to the specified AppWidgetProviderInfo in this meta-data is added to the home screen, deleted, or updated by the user, the Receiver specified by this name will receive the widget. to the corresponding broadcast. The broadcast Intent contains the id of the corresponding AppWidget. This id can be used to find the corresponding AppWidget through AppWidgetManager

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template