如何将小工具添加到从我的应用程序在Android主屏幕?我的、如何将、应用程序、小工具

由网友(┼兂情 尐哖)分享简介:我在写这应该能够部件(只是文本框)添加到用户的手机的主屏幕,当用户指示我的应用程序这样做的应用程序。我该怎么做这样的事?I'm writing an application which should be able to add widgets (just text boxes) to the home screen...

我在写这应该能够部件(只是文本框)添加到用户的手机的主屏幕,当用户指示我的应用程序这样做的应用程序。我该怎么做这样的事?

I'm writing an application which should be able to add widgets (just text boxes) to the home screen of the user's phone when the user instructs my app to do so. How can I do such a thing?

我知道,我可以添加一个应用程序窗口小部件,但如何增加更多的?

I know that I can add an app widget but how about adding more?

推荐答案

这是不可能的,从一个应用程序放置一个小部件在主屏幕。只有主屏幕可以添加应用程序,窗口小部件的主屏幕。

It is not possible from a app to place a widget in the home screen. Only the home screen can add app widgets to the home screen.

相似的链接 LINK1 ,的链接2 ,link3

但你可以提供用户从widgetpicker部件挑选。

But you can offer user to pick widget from widgetpicker.

    Intent pickIntent = new Intent(AppWidgetManager.ACTION_APPWIDGET_PICK);
    pickIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetID);
    startActivityForResult(pickIntent, KEY_CODE);
阅读全文

相关推荐

最新文章