开发者

Accessing AppWidgetHost to launch the 'Add Widget' activity from within my program's activity

I would like to add the ability for a user to launch the Add Widget activity to choose my application's widget to add to their phone's homescreen from within my application.

I was following this example: Android:NPE while trying to activityForResult with ACTION_APPWIDGET_PICK intent, but realized that I didn't have the homescreens AppWidgetHost.

I know I need to use the AppWidgetManager.ACTION_APPWIDGET_PICK, but Android Developer says that I need to launch this from within my AppWidgetHost. If I am trying to get the appwidget onto the homescreen, this implies that I need to gain access to that instance of the AppWidgetHost. How would I get access to that or 开发者_如何学Pythonget that instance? Is it even possible to do anything with the homescreen's AppWidgetHost?


How would I get access to that or get that instance?

You can't. That's not in your process.

Is it even possible to do anything with the homescreen's AppWidgetHost?

Only if you are the home screen in question.

I would like to add the ability for a user to launch the Add Widget activity to choose my application's widget to add to their phone's homescreen from within my application.

AFAIK, this is not supported.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜