0
我有一个透明的活动,用于获取AlertDialog
。这个AlertDialog
随时出现我的应用程序获取推送通知(前景或背景)。但是当AlertDialog
出现,并且如果在背景中有另一个Activity
AlertDialog
出现在此Activity
的顶部。当用户点击通知时,我只想看到AlertDialog
。Android显示透明活动
这里是示出AlertDialog
当应用程序是前景
Intent dialogIntent = new Intent(getApplicationContext(), DialogActivity.class);
MainActivity.this.startActivity(dialogIntent);
MainActivity.this.finish();
而当应用程序是背景我使用PendingIntent
Intent dialogIntent = new Intent(getApplicationContext(), DialogActivity.class);
final PendingIntent resultPendingIntent =
PendingIntent.getActivity(
mContext,
0,
dialogIntent ,
PendingIntent.FLAG_CANCEL_CURRENT
);
是否有示出溶液中的代码只AlertDialog
当用户敲击通知?任何帮助,将不胜感激。
您可以使用自定义布局的警报对话框打开弹出窗口。我有一个代码显示弹出使用警报对话框定制 –
这里是你的解决方案http://stackoverflow.com/a/2700683/6676466 –
@ApoorvMehrotra有没有问题,打开弹出。 – Tartar