0
画面ピン/グラフィックキーロック付き電話機にバグがあります。それがなければうまくいく。画面にピン/グラフィックキーがある場合、プッシュ通知でアクティビティが開かない
プッシュ通知のユーザータップでメインアクティビティが開始され、そのすべてが開始されると、ピンまたはグラフィックキーがない場合、必要なアクティビティが開始されます。
これは私のGCMリスナーのコードです:
@Override
public void onMessageReceived(String from, Bundle data) {
String id = data.getString("news_id");
String message = data.getString("message");
Random random = new Random();
Intent intent = new Intent(this, SpecificNewsActivity.class);
intent.putExtra("newsId", id);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
PendingIntent pendingIntent = PendingIntent.getActivity(this, random.nextInt(), intent,
PendingIntent.FLAG_ONE_SHOT);
Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this)
.setSmallIcon(R.mipmap.ic_launcher)
.setContentTitle(getString(R.string.app_name))
.setContentText(message)
.setAutoCancel(true)
.setSound(defaultSoundUri)
.setContentIntent(pendingIntent);
NotificationManager notificationManager =
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(random.nextInt(), notificationBuilder.build());
}
任意のアイデアをどのようにこの問題を解決するには?
編集:この問題は、中国の携帯電話(Meizu、Xiaomi)にのみ存在するようです。
デバイスにロックPIN /パスワードがありますか? –
、デバイスにロック/ PINがある場合は、自分のデバイスでアクティビティ –
@ cricket_007を開くことは理想的ではありません。 –