Intent intent = new Intent(context, MainActivity.class);
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0);
remoteViews.setOnClickPendingIntent(R.id.button, pendingIntent);
the MainActivity was started. This did not happen when onReceive was called. Therefore, I had to add these lines to the onReceive function (I had to rename intent in localIntent because onReceive has a parameter Intent intent). Afterwards, everything worked fine.
No comments:
Post a Comment