我按照本教程创建了一个推送通知应用程序:http://www.vogella.com/articles/AndroidCloudToDeviceMessaging/article.html
它工作正常,花花公子,当我收到通知时,我可以打开一个网站.但是,我能够将webview布局与此推送通知应用程序结合起来吗?我觉得它必须是可能的,因为电子邮件通知以这种方式工作.
这是我的代码处理我收到的通知:
private void handleData(Context context, Intent intent) {
String app_name = (String)context.getText(R.string.app_name);
String message = intent.getStringExtra("message");
// Use the Notification manager to send notification
NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
// Create a notification using android stat_notify_chat icon.
Notification notification = new Notification(android.R.drawable.stat_notify_chat, app_name + ": " + message, 0);
// Create a pending intent to call the webviewactivity when the notification is clicked
PendingIntent pendingIntent = PendingIntent.getActivity(context, -1, new Intent(context, webviewactivity.class), PendingIntent.FLAG_UPDATE_CURRENT); //
notification.when = …Run Code Online (Sandbox Code Playgroud)