Действия по воспроизведению проблемы:
Вы знаете, как избежать этой проблемы? (Я видел несколько похожих вопросов по stackoverflow, но не совсем то, что мне нужно)
Спасибо !!!!
Код:
public class MyWidgetProvider extends AppWidgetProvider {
public void onUpdate(Context context, AppWidgetManager appWidgetManager,
int[] appWidgetIds) {
// Build the intent to call the service//
RemoteViews remoteViews = new RemoteViews(context.getPackageName(), R.layout.widget_layout);
Intent openAppIntent = new Intent(context.getApplicationContext(), MainActivity.class);
openAppIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, appWidgetIds);
PendingIntent openAppPendingIntent = PendingIntent.getActivity(context, 0, openAppIntent, 0);
remoteViews.setOnClickPendingIntent(R.id.widgetLinearLayout, openAppPendingIntent);
//// ETC…///
}