mirror of
https://github.com/xdsopl/robot36.git
synced 2025-12-31 13:50:35 +01:00
add some flag to pending intent when needed
This commit is contained in:
parent
fb4e406d7b
commit
93a89ebfca
|
|
@ -73,7 +73,10 @@ public class MainActivity extends AppCompatActivity {
|
|||
|
||||
private void showNotification() {
|
||||
Intent intent = new Intent(this, MainActivity.class);
|
||||
PendingIntent pending = PendingIntent.getActivity(this, 0, intent, 0);
|
||||
int flags = 0;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S)
|
||||
flags = PendingIntent.FLAG_IMMUTABLE;
|
||||
PendingIntent pending = PendingIntent.getActivity(this, 0, intent, flags);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
NotificationChannel channel = manager.getNotificationChannel(channelID);
|
||||
if (channel == null) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue