私は通知プロジェクトに取り組んでいます。通知にURLリンクを渡す必要があります。ユーザーが通知をクリックするとアクティビティXに移動し、そのURLがアクティビティXにあるWebビューで開きます。通知のURLリンクを渡すにはどうすればいいのですか?それをクリックするとwebviewで開くはずですか?
これは私がやっているものです...そのURLを開くのではなく、私のWebViewの中で、私が私のWebViewでそのリンクを開きたいphone..but中にブラウザの存在を選択するように求めているではない
Context context = this.getApplicationContext();
notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
// Intent mIntent = new Intent(this, MainActivity.class);
Intent notificationIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.google.com"));
Bundle bundle = new Bundle();
bundle.putString("test", "test");
notificationIntent.putExtras(bundle);
pendingIntent = PendingIntent.getActivity(context, 0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);
ただ!!!
ありがとうございます。
サーバーには、サーバー側のリダイレクトを発行している。https://stackoverflow.com/questions/2893815/hello-webview-tutorial-opens-the-requested -add-in-android-browser-and-not/2893868?s = 1 | 0.7983#2893868 – CommonsWare