Flurry ads kill my android service and widget views

孤街醉人 提交于 2019-12-10 23:56:27

问题


I added

FlurryAgent.getAds(..) within my activity. My activity is launched by a widget and information is cached via a service.

If the user clicks an ad and it goes to full screen, my widget no longer responds to clicks and the service no longer updates the views on the widget. It stays like this unless the user removes the widget from the launcher screen and adds it back again.

I handle low memory situations with the service this way in onStartCommand():

            RemoteViews views = new RemoteViews(getPackageName(), R.layout.activity_main);
    AppWidgetManager appWidgetManager = AppWidgetManager
            .getInstance(context);
    int[] appWidgetIds = appWidgetManager
            .getAppWidgetIds(new ComponentName(context,
                    MainWidget.class.getName()));
    for (int i = 0; i < appWidgetIds.length; i++) {
        appWidgetManager.updateAppWidget(appWidgetIds[i], views);
    }

    return START_STICKY; 

where the appWidgetIds are always supposed to update the appWidgetManager to keep the remoteviews clickable, and the START_STICKY flag is supposed to handle this exact situation regarding service reinstantiation.

The Flurry full screen ad seems to somehow kill it anyway though

please advise

来源:https://stackoverflow.com/questions/14028123/flurry-ads-kill-my-android-service-and-widget-views

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!