android - 以编程方式将应用程序小部件设置为主屏幕

标签 android android-appwidget

我想将我的自定义应用程序小部件设置为主屏幕。我已经搜索了很多并实现了代码并运行了一些演示但是总的来说,点击按钮小部件后发生的事情不能设置到主屏幕,而是从设备点击菜单设置

Add->Widgets->Then my widget Icon

点击我的小部件图标后,它将设置为主屏幕。

但我不需要这个,我希望在点击我的 Activity 小部件中的按钮后,无需转到此处即可将其设置为主屏幕。

Add->Widgets->Then my widget Icon

所以请帮助我实现这种方法。

最佳答案

i want that after click on button from my activity widget will be set to home screen without going here

那是不可能的。

关于android - 以编程方式将应用程序小部件设置为主屏幕,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23196053/

相关文章:

android - 日期选择器安卓 :calendarViewShown

Android AppWidget : new instance freezing old one

Android 应用小部件 : how to change color AND transparency of ImageView

android - 如何正确更新AppWidget?

android - 如何避免旧的小部件在主要代码返工期间失败/消失?

android - setCompoundDrawables 与 RemoteViews

android - 如何为多选列表首选项实现 'Select all' 选项?

android - 如何在 ParseUser 对象中查找用户

android - "context"到底是什么意思?对于 soundPool.load int load(Context context, int resId, int priority)

Android 以编程方式加载可绘制对象并调整其大小