是这样的,我启动一个activity时也启动了notification,然后在activity输入相关内容,但是我点HOME键返回android的桌面,在点notification的小图标切到activity时却新建了这个activity,请问怎么解决??
后来我加了这个intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP)
问题又来了,如果我在activity中打开另外一个activity,这是反回桌面,在点notifcation图标时,却又新建了一次activity,
请问这个如何解决。。
另外我看到linphone启动时,状态栏上也有一个图标,不过它不是notificaon,你拖下来时,你会发现这个图标在ongoing里面,请问这个怎么做啊??
------最佳解决方案--------------------
onSaveInstanceState() 和 onRestoreInstanceState() 会用吗?
------其他解决方案--------------------
怎么重写不行啊? 我保存状态都是重写这个函数. 这种函数是你又需要就重写, 没需要就不必. 现在你有需要了.
------其他解决方案--------------------
可以尝试下!
------其他解决方案--------------------
保留activity的状态
onSaveInstanceState() 和 onRestoreInstanceState()
就这俩东西能满足LZ的需要。
------其他解决方案--------------------
该回复于2010-07-28 16:56:10被版主删除
------其他解决方案--------------------
重写方法好像不行吧
------其他解决方案--------------------
这个每个activity里面都要重写吗?
------其他解决方案--------------------
我来试试,你们有做过类似的应用吗
------其他解决方案--------------------
我总感觉这边出了问题
Notification notification = new Notification(drawable, tickerText,
System.currentTimeMillis());
notification.flags = Notification.FLAG_ONGOING_EVENT;
intent = new Intent(this, TestNotification.class);
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
pendIntent = PendingIntent.getActivity(this, 0, intent, 0);
这个intent的flag状态
------其他解决方案--------------------
没人吗??在线等啊
------其他解决方案--------------------
如何重写??
就直接把这两上方法写出来就行?
------其他解决方案--------------------
搞定喽,这个notification...搞死我了...改天我会总结一下.
onSaveInstanceState() 和 onRestoreInstanceState() 这两个我没有用到。。
在notification中有时需要Class.forName()动态的取得要跳转的activity
------其他解决方案--------------------
我也遇到同样问题,能否将解决办法告诉我一下.
急
------其他解决方案--------------------
该回复于2011-01-12 16:43:56被版主删除
------其他解决方案--------------------