English 中文(简体)
通知中的活动令
原标题:Activity order from notification
  • 时间:2011-09-13 09:53:44
  •  标签:
  • android

我对“安”通知和活动令有问题。

我有以下设想:

我的第一项活动是“Main”,它执行了一些任务。 当BACKhton受到压力时,它会产生通知。 活动_Main有以下电话(onKeyDown(),OnPause(,OnStop(),OnDestroy()。 用户点击通知icon Activities_ 主要内容开始,电话序列为OnCreate(,OnResume()。 罚款。

现在的活动——Main 包含开始的纽顿 活动——二次使用<代码>StartActativeForResult( api并生成任务进展通知,职能电话为onSaveInstance(,OnPause(,OnStop()。 如果用户通过<条码>复读<>条码/代码>向纽芬兰报到活动,则所有物品都将进行罚款。 但是,如果用户选择通知icon(活动_seconds是显而易见的),那么关于活动_main的新事例(onCreate(,OnResume(<>)。 活动 第二,应将其关闭(onResume(> of Activities_Main)。 如今,活动——Main(2nde),活动——二,活动——Main(1ste)正在活动。

我在发出通知时悬挂着国旗。

notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP|Intent.FLAG_ACTIVITY_SINGLE_TOP);

解决这一问题还有什么办法?

最佳回答

@ vineet, it didnt help.

Intent notificationIntent = new Intent(this,Activity_Main.class);

and

<activity ....android:launchMode="singleTask" >

togather helped me to solve this... from this link

问题回答

试图在你的意图中添加这些旗帜:

notificationIntent.addFlags(Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY);
notificationIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);




相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签