2013-10-24 7 views
1

Как возобновить приложение Android из Уведомления? Я хочу иметь возможность возобновить экземпляр с того места, где он ушел, со всеми ограниченными службами и настройками и т. Д. Вместо полного нового экземпляра. Это мой код:Возобновление Android-приложения извещения

String ns = Context.NOTIFICATION_SERVICE; 
     mNotificationManager = (NotificationManager) 
                getSystemService(ns); 

     Intent notificationIntent = new Intent(this, MeasurementsStarter.class); 
     PendingIntent contentIntent = PendingIntent.getActivity(
                this, 0, notificationIntent, 0); 
     // the next two lines initialize the Notification, using the configurations 
     // above 
     notification = new Notification(R.drawable.ic_launcher, "Metingen draaien",System.currentTimeMillis()); 
     notification.setLatestEventInfo(getBaseContext(), "Metingen ManDown", "Metingen Mandown draaien nog", 
                    contentIntent); 
     notification.flags = Notification.FLAG_ONGOING_EVENT | Notification.FLAG_NO_CLEAR; 
     notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); 
     final int HELLO_ID = 1; 
     mNotificationManager.notify(HELLO_ID, notification); 

ответ

0

я вроде нашел ответ, я вручную установить данные из всех моих TextFields и т.д., а просто кладу bindService в моем методе OnCreate(). Это возможно не самый изящный способ, но тем не менее он работает

Смежные вопросы