I can’t find a way to correctly transfer add-ons from widgets to Activity .
I did not open activity when I pressed a button with additional functions transferred.
Intent intent = new Intent(context, CreateOperationsActivity.class); intent.putExtra("someKey", true); PendingIntent pendingIntent = PendingIntent.getActivity(context, Constants.RequestCodes.CREATE_OPERATIONS, intent, PendingIntent.FLAG_UPDATE_CURRENT); views.setOnClickPendingIntent(R.id.add_expense_button, pendingIntent);
Activity opens, but in Intent there is no superfluous.
The only way I could pass this additional parameter was to set the PendingIntent flag to PendingIntent.FLAG_ONE_SHOT , but then the widget button only works if clicking on it takes no action.
How to do this so that the extra interception is an Activity , and the button works every time?
source share