任何人都可以说出如何使用PendingIntent启动新的Activity以及如何使用挂起的意图传递值. 预先感谢.
Can anyone please say how to launch a new Activity using PendingIntent and also to pass a value using pending intent. Thanks in advance.
推荐答案Intent intent = new Intent(getApplicationContext(), ActivityToLaunch.class); intent.putExtra(<oneOfThePutExtraFunctions>); PendingIntent pi = PendingIntent.getActivity(this, 0, intent, 0);
您可以使用以下各种Intent.PutExtra()函数之一将额外的数据添加到Intent中: developer.android/reference/android/content/Intent.html
You can add extra data into an Intent by using one of the various Intent.PutExtra() functions located: developer.android/reference/android/content/Intent.html
然后,当您准备启动PendingIntent时,请使用位于以下位置的Send()函数之一: developer.android/reference/android/app/PendingIntent.html
Then, when you are ready to launch your PendingIntent, use one of the Send() functions located: developer.android/reference/android/app/PendingIntent.html
更多推荐
如何使用待定意图启动新活动
发布评论