2017-05-23 31 views
0

我做的是以下几点:小工具有时不重新启动后,工作

// prepare 
mAppWidgetManager = AppWidgetManager.getInstance(applicationContent); 
mAppWidgetHost = new LauncherAppWidgetHost(applicationContent, R.string.app_name); 

// create widget 
int appWidgetId = ...; // the id of the widget, that I have saved 
AppWidgetProviderInfo appWidgetInfo = mAppWidgetManager.getAppWidgetInfo(appWidgetId); 
AppWidgetHostView hostView = mAppWidgetHost.createView(context, appWidgetId, appWidgetInfo); 
hostView.setAppWidget(appWidgetId, appWidgetInfo); 

// show view 
// now I just display the hostView 

问题

一些设备一些小部件它发生的小部件也停止工作重新启动后(在widgetView是重新启动后只是一个空视图)。任何想法为什么发生这种情况我问我的用户尝试在家里发射相同的部件,并在那里的小部件会继续重新启动后,工作以及...

回答

0

我有同样的问题,但我瑶池另一种方式来解决这个问题:在XML窗口小部件,我添加的TextView文本“窗口小部件更新”,并在Java代码编程隐藏该TextView的。所以,当你重新启动设备和widget仍然没有出现,小窗口这段文字是出路的情况

相关问题