申请(非通缉)行为 -
但是 - 不是原始实例,而是启动新实例(例如,在最新实例中缺少原始文本;当最新实例关闭时,仍然存在具有原始文本的原始实例).
通知方法的代码
Context context = getApplicationContext();
CharSequence contentTitle = "someText1";
CharSequence contentText = "someText2";
Intent notifyIntent = new Intent(Intent.ACTION_MAIN);
notifyIntent.setClass(getApplicationContext(), RadioStream.class);
PendingIntent intent =
PendingIntent.getActivity(RadioStream.this, 0, notifyIntent, 0);
notifyDetails.setLatestEventInfo(context, contentTitle, contentText, intent);
mNotificationManager.notify(SIMPLE_NOTFICATION_ID, notifyDetails);
Run Code Online (Sandbox Code Playgroud)
我也在清单xml文件中跟随标记
android:launchMode="singleTask"
Run Code Online (Sandbox Code Playgroud)
但它仍然是相同的...主要问题是应用程序的双/三初始化,我知道还有其他方法可以保留恢复的应用程序中的值.此外,还需要应用程序在后台运行,因为主要功能是互联网广播流.
代码中缺少什么?我方缺少哪些信息来解决问题?
谢谢!
DAV