當我點擊狀態欄通知時,它會加載我的webview,但每次都會重新加載它。有沒有辦法加載保存的狀態?由於這裏是我有:從狀態欄通知啓動webview類
@Override
public void onStart(Intent intent, int startid) {
String ns = Context.NOTIFICATION_SERVICE;
NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns);
int icon = R.drawable.notification_icon;
CharSequence tickerText = "Now playing...";
long when = System.currentTimeMillis();
Notification notification = new Notification(icon, tickerText, when);
Context context = getApplicationContext();
CharSequence contentTitle = "Music Promotion";
CharSequence contentText = "Now Playing...";
Intent notificationIntent = new Intent(this, mainmenu.class);
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);
notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);
mNotificationManager.notify(HELLO_ID, notification);
}
您好,請解釋一下你的問題/您的要求,在這裏把你的代碼,這樣的理解會很容易。 – anddev
我的應用程序是一個web瀏覽器,當單擊一個mp3鏈接時啓動mediaplayer,並在這種情況發生時創建一個狀態欄通知。當你點擊狀態欄通知時,它會啓動我的mainmenu.class這是webview。當發生這種情況時,webview會從頭開始加載,我不希望發生這種情況。我希望它打開並且不做任何事(在他們所在的網頁上留下餘地) –
我用更多的代碼編輯了這個問題。我認爲它在點擊狀態欄通知時觸發了onCreate方法,我不希望這樣做。我只是希望它切換到視圖或打開它 –