Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/197.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 使用通知显示对话框片段_Java_Android_Notifications - Fatal编程技术网

Java 使用通知显示对话框片段

Java 使用通知显示对话框片段,java,android,notifications,Java,Android,Notifications,我在我的.MainActivity类中设置了如下通知: Intent downloadUpdateIntent = new Intent(mContext, updateAppDialogFragment.class); PendingIntent downloadAppPendingIntent = PendingIntent.getActivity(mContext,0,downloadUpdateIntent,0); NotificationCompa

我在我的
.MainActivity
类中设置了如下通知:

 Intent downloadUpdateIntent = new Intent(mContext, updateAppDialogFragment.class);
            PendingIntent downloadAppPendingIntent = PendingIntent.getActivity(mContext,0,downloadUpdateIntent,0);


    NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(mContext)
            .setSmallIcon(R.drawable.ic_launcher)
            .setContentTitle("Update Available")
            .setContentText("A new version of this app is available.")
            .setDefaults(Notification.DEFAULT_ALL)
            .setPriority(Notification.PRIORITY_HIGH)
            .addAction(0,"Update",downloadAppPendingIntent);

            NotificationManager notificationManager = (NotificationManager) getSystemService(mContext.NOTIFICATION_SERVICE);
            notificationManager.notify(1, mBuilder.build());
我需要的是,当我点击
update
按钮时,它应该显示
updateapdialogfragment
以显示更新进度。当我通常使用这个类时,我需要进行这样的调用
updateAppDialogFragment.newInstance()
。但在这里,我不明白如何做到这一点。有人帮忙吗

我对意图有非常基本的了解。实际上,我需要知道的是使用意图来调用一个方法