开发者

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

开发者 https://www.devze.com 2023-03-31 16:34 出处:网络
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 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

精彩评论

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