編輯:高級開發
下面列出一些常用的動作:
Constants String ACTION_APPWIDGET_CONFIGURE Sent when it is time to configure your AppWidget while it is being added to a host. String ACTION_APPWIDGET_DELETED Sent when an instance of an AppWidget is deleted from its host. String ACTION_APPWIDGET_DISABLED Sent when an instance of an AppWidget is removed from the last host. String ACTION_APPWIDGET_ENABLED Sent when an instance of an AppWidget is added to a host for the first time. String ACTION_APPWIDGET_PICK Send this from your AppWidgetHost activity when you want to pick an AppWidget to display. String ACTION_APPWIDGET_UPDATE Sent when it is time to update your AppWidget. String EXTRA_APPWIDGET_ID An intent extra that contains one appWidgetId. String EXTRA_APPWIDGET_IDS An intent extra that contains multiple appWidgetIds. String EXTRA_CUSTOM_EXTRAS An intent extra to pass to the AppWidget picker containing a List of Bundle objects to mix in to the list of AppWidgets that are installed. It will be added to the extras object on the Intent that is returned from the picker activity. String EXTRA_CUSTOM_INFO An intent extra to pass to the AppWidget picker containing a List of AppWidgetProviderInfo objects to mix in to the list of AppWidgets that are installed. int INVALID_APPWIDGET_ID A sentIEl value that the AppWidget manager will never return as a appWidgetId. String META_DATA_APPWIDGET_PROVIDER FIEld for the manifest meta-data tag. AppWidgetManager提供的一些方法可以綁定你的Widget、通過provider名稱獲取對應的id,獲取一個widget provider信息等,平時可能只使用getInstance獲取一個實例,以及updateAppWidget這個方法,需要注意的是它提供了3種重載方法,可以更新一個widget組,或通過CompoentName來識別最終的對象,同時在Widget中一般界面的顯示使用了RemoteVIEws這個類,以後我們會著重講解下它有哪些特別之處。 Public MethodsObject
.
wait()
methods) to be woken up.
wait()
methods) to be woken up.
notify()
or notifyAll()
method of this object or until the specifIEd timeout expires.
notify()
or notifyAll()
method of this object or until the specifIEd timeout expires.
notify()
or notifyAll()
method of this object.
Sent when it is time to configure your AppWidget while it is being added to a host. This action is not sent as a broadcast to the AppWidget provider, but as a startActivity to the activity specifIEd in the AppWidgetProviderInfo meta-data.
The intent will contain the following extras:
EXTRA_APPWIDGET_ID The appWidgetId to configure.If you return RESULT_OK using Activity.setResult(), the AppWidget will be added, and you will receive an ACTION_APPWIDGET_UPDATE broadcast for this AppWidget. If you return RESULT_CANCELED, the host will cancel the add and not display this AppWidget, and you will receive a ACTION_APPWIDGET_DELETED broadcast.
Constant Value: "android.appwidget.action.APPWIDGET_CONFIGURE"Sent when an instance of an AppWidget is deleted from its host.
Sent when an instance of an AppWidget is removed from the last host.
Sent when an instance of an AppWidget is added to a host for the first time. This broadcast is sent at boot time if there is a AppWidgetHost installed with an instance for this provider.
Send this from your AppWidgetHost activity when you want to pick an AppWidget to display. The AppWidget picker activity will be launched.
You must supply the following extras:
EXTRA_APPWIDGET_ID A newly allocated appWidgetId, which will be bound to the AppWidget provider once the user has selected one.The system will respond with an onActivityResult call with the following extras in the intent:
EXTRA_APPWIDGET_ID The appWidgetId that you supplIEd in the original intent.When you receive the result from the AppWidget pick activity, if the resultCode is RESULT_OK, an AppWidget has been selected. You should then check the AppWidgetProviderInfo for the returned AppWidget, and if it has one, launch its configuration activity. If RESULT_CANCELED is returned, you should delete the appWidgetId.
Sent when it is time to update your AppWidget.
This may be sent in response to a new instance for this AppWidget provider having been instantiated, the requested update interval having lapsed, or the system booting.
The intent will contain the following extras:
EXTRA_APPWIDGET_IDS The appWidgetIds to update. This may be all of the AppWidgets created for this provider, or just a subset. The system trIEs to send updates for as few AppWidget instances as possible.An intent extra that contains one appWidgetId.
The value will be an int that can be retrIEved like this:
Bundle extras = intent.getExtras();int appWidgetId = extras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID);Constant Value: "appWidgetId"
An intent extra that contains multiple appWidgetIds.
The value will be an int array that can be retrIEved like this:
Bundle extras = intent.getExtras();int[] appWidgetIds = extras.getIntArray(AppWidgetManager.EXTRA_APPWIDGET_IDS);Constant Value: "appWidgetIds"
An intent extra to pass to the AppWidget picker containing a List of Bundle objects to mix in to the list of AppWidgets that are installed. It will be added to the extras object on the Intent that is returned from the picker activity.
Constant Value: "customExtras"An intent extra to pass to the AppWidget picker containing a List of AppWidgetProviderInfo objects to mix in to the list of AppWidgets that are installed. (This is how the launcher shows the search widget).
Constant Value: "customInfo"A sentIEl value that the AppWidget manager will never return as a appWidgetId.
Constant Value: 0 (0x00000000)FIEld for the manifest meta-data tag.
Set the component for a given appWidgetId.
You need the APPWIDGET_LIST permission. This method is to be used by the AppWidget picker.
Get the list of appWidgetIds that have been bound to the given AppWidget provider.
Get the available info about the AppWidget.
Return a list of the AppWidget providers that are currently installed.
Get the AppWidgetManager instance to use for the supplIEd Context object.
Set the RemoteViews to use for the specifIEd appWidgetIds.
It is okay to call this method both inside an ACTION_APPWIDGET_UPDATE broadcast, and outside of the handler. This method will only work when called from the uid that owns the AppWidget provider.
Set the RemoteViews to use for all AppWidget instances for the supplIEd AppWidget provider.
It is okay to call this method both inside an ACTION_APPWIDGET_UPDATE broadcast, and outside of the handler. This method will only work when called from the uid that owns the AppWidget provider.
Set the RemoteViews to use for the specifIEd appWidgetId.
It is okay to call this method both inside an ACTION_APPWIDGET_UPDATE broadcast, and outside of the handler. This method will only work when called from the uid that owns the AppWidget provider.
om/img/xlovey/201008/2010080509204739.png alt= /> 4.生成JNI頭文件 下面生成JNI 頭文件啦,使用 ja
盡管蘋果聯合創始人承認:android將取得最終勝利,不過很多人認為過於開放的環境依然不利於android,無差異的應用體驗正在制約Android超過iPhone。日前
學習android DDMS時,經常會遇到android DDMS問題,這裡將介紹android DDMS問題的解決方法。Android DDMS有很多值得學習的地方,
下面文章主要說明一下android 源代碼的相關知識和簡單的操作技巧,為了讓大家更深的一步了解android 源代碼操作,這裡將用圖示的方法給廣的用戶講解學習,歡迎大家