I have a widget in android that works correctly when I set targetSdk<26, but when I set targetSdk>=26 onReceive() doesn't fired and my widget doesn't update.
i don't know what's wrong with that?
I used below code to update my widget in button click.
updateViews.setOnClickPendingIntent(R.id.age_rotated_layout_larg, getPendingIntent(context, MOVE, appWidgetId));
private PendingIntent getPendingIntent(Context context,String action,int id) { Intent intent = new Intent(action);
intent.putExtra("ID", id);
PendingIntent pendingIntent = PendingIntent.getBroadcast(context,
id,intent,PendingIntent.FLAG_UPDATE_CURRENT);
return pendingIntent;
}