Android Notification Push avec WebView?

J'ai créé un push notifications d'application suivant ce tutoriel: http://www.vogella.com/articles/AndroidCloudToDeviceMessaging/article.html

Il fonctionne très bien et dandy, et quand je reçois la notification, je peux ouvrir un site web. Cependant, je suis en mesure de combiner la webview mise en page avec ce push notifications d'application? J'ai l'impression que cela est possible parce que l'e-mail les notifications de travaux.

Voici mon code qui gère la notification-je recevoir:

    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 = System.currentTimeMillis();  
    notification.flags |= Notification.FLAG_AUTO_CANCEL; 
    //Set the notification and register the pending intent to it
    notification.setLatestEventInfo(context, app_name, message, pendingIntent); //

    //Trigger the notification
    notificationManager.notify(0, notification);
}

Cependant, la HomeActivity qui est liée à la main.xml est juste un bouton pour enregistrer et annuler l'inscription de votre appareil pour recevoir les notifications. J'ai créé un autre fichier, webviewactivity.xml sous mise en page:

 <?xml version="1.0" encoding="utf-8"?>
 <WebView  xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
 />

et j'ai créé l'activité suivante, webviewactivity

 public class BHWebView extends Activity {

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.bhwebview_activity);

    WebView myWebView = (WebView) findViewById(R.id.webview);
    myWebView.loadUrl("http://www.badgerherald.com");

    //TODO Auto-generated method stub
}

  }

Pour quelque raison que lorsque je clique sur ma notification qu'il ouvre la maison de l'activité, pas la webview activité.

Salut, je suis nouvelle application android, je veux savoir est une webview app bonne, dans le sens de la convivialité des utilisateurs (pour un site e-commerce ) ? J'ai un site e-commerce, je vais le convertir en webview android app, alors ii être en mesure d'envoyer pushnotification à mes utilisateurs de l'application ? Merci de m'aider

OriginalL'auteur Kevin | 2012-05-07