Sto tentando di aprire un frammento quando si preme una notifica nella barra di notifica. La mia struttura app è:Come aprire la pagina di frammento, quando si preme una notifica in Android
- un'attività di base con un menu cassetto nav
qualche frammento che si aprono dal menù
b.setOnClickListener(new OnClickListener() { @SuppressWarnings({ "deprecation", "static-access" }) public void onClick(View v) { w_nm=(NotificationManager) getActivity().getSystemService(getActivity().NOTIFICATION_SERVICE); Notification notify=new Notification(R.drawable.notnificationlogo,waternoti,System.currentTimeMillis()); Intent notificationIntent = new Intent(getActivity(), Abc.class); PendingIntent pending=PendingIntent.getActivity(getActivity(), 0,notificationIntent, 0); notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); notify.flags = Notification.DEFAULT_LIGHTS | Notification.FLAG_AUTO_CANCEL; notify.setLatestEventInfo(getActivity(),waternoti,waternoti1, pending); w_nm.notify(0, notify);
Qualcuno può dirmi come collegare con frammento successivo pagina (il codice presente è in classe che estende il frammento)
Broadcast Receiever? http://developer.android.com/reference/android/content/BroadcastReceiver.html – James
Potresti compilarlo, sono nuovo in Android –