Hi friends, In my MainActivity (extends TabActivity) has 5 tabs. suppose i am in 2nd tab and i receive a push notification,without closing the app i open the notification it switches to 3rd tab,when i press back, i show a dialog saying 'Are you sure you want to exit' when i say YES it goes to the third tab. but I want to exit the app. How to acheive this.In the manifest I have declared as <activity android:name=".MainActivity" android:launchMode="singleTask" android:alwaysRetainTaskState="true" android:screenOrientation="portrait" android:theme="@style/MyTheme" android:windowSoftInputMode="stateAlwaysHidden" />
Below is the onReceive method of IntentReceiver @Override public void onReceive(Context arg0, Intent aIntent) { String action = aIntent.getAction(); if (action.equals(PushManager.ACTION_NOTIFICATION_OPENED)) { // user opened the notification so we launch the application // This intent is what will be used to launch the activity in our // application Intent lLaunch = new Intent(Intent.ACTION_MAIN); // Main.class can be substituted any activity in your android // project that you wish // to be launched when the user selects the notification from the // Notifications drop down lLaunch.setClass(UAirship.shared().getApplicationContext(), MainActivity.class); lLaunch.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); UAirship.shared().getApplicationContext().startActivity(lLaunch); } else if (action.equals(PushManager.ACTION_PUSH_RECEIVED)) { // push notification received, perhaps store it in a db } } Please tell me what I am supposed to do and where I am going wrong. -- Regards, Vani Reddy -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en