Android :: How To Add Activity To App To Task History?
Mar 16, 2009
I'm trying to write a mediaplayer activity launched from browser. But I found if I launch mediaplayer activity from browser, it won't be shown in the task history window(long press home key). And if I launch mediaplayer activity launched from home, it can be shown in the task history window. Is there any way to make mediaplayer activity to be shown in the task history window when launching it from the browser activity?
View 2 Replies
Aug 12, 2010
I'm working on an app that launches the browser activity to perform a Twitter OAuth authorization. This process uses a callback url which will re-launch the activity that started the browser activity in the first place.My problem is that the browser pages remain in the history stack and when the user then clicks back from the preferences activity that launched the browser in the first place, they don't go back to the app's main activity, but instead are brought back to the browser. I've tried adding flags to the launching intent to prevent history and reset on clear, but it doesn't seem to work when running on my phone, only on the emulators.
View 1 Replies
View Related
Apr 22, 2010
I have a huge maze of activities in my application. What I need to do, is that when the user logs in into the system, the activity history should be cleared. I cant just use finish() when I start a new activity, because I want the activities to have a history until the user logs in. I have experimentet with the different flags when starting an activity, but I have had no success.
View 1 Replies
View Related
Jun 12, 2010
As it has already been noted in EVO threads, SystemPanel App / Task Manager history /installer and a few other features no longer work. That is because it has finally broken into a lite ver and paid ver.
The lite (free) might be fine for most. The paid is $2.99, well worth it IMO.
View 7 Replies
View Related
Aug 1, 2009
I have 3 activities, I want to allow only one of each of the activities to be on the history stack at one time.A>B>C>[GO TO B] gives me A>C>B using FLAG_ACTIVITY_REORDER_TO_FRONT flag.Now the problem is that when I call B from C I want B to be restarted not just brought to the front.how can I do that?
View 3 Replies
View Related
Oct 13, 2010
I have total 3 activities.
First activity(A) starts second activity(B). From Activity B, 3rd activity(C) is called.
Activity B, shows list with checkbox to select items and single OK button. On clicking OK button Activity C is called with selection.
When user clicks BACK button in Activity C, by default Activity B is displayed (with selected checkbox).
I want to display Activity A when BACK button is clicked in Activity C.
How to achieve that?
I have handled OnKeyDown() in Activity C to startactivity(A). it is working. But when user clicks BACK button on Activity A, again Activity C is displayed. while application should end.
In this direction how to skip Activity B is ever called?
View 1 Replies
View Related
Dec 17, 2009
When debugging I've sometimes wanted a tool that would list running tasks and show which activities are on the history stack for each task. I can get a list of tasks by calling ActivityManager.getRunningTasks(). Each ActivityManager.RunningTaskInfo object in the list gives me interesting information such as the base activity, top activity, and number of activities in the task. I haven't found a way to actually enumerate all the activities in the task's history stack. Is there a way to get at such information?
View 2 Replies
View Related
Dec 14, 2009
My app shows a signup activity the first time the user runs the app, looks like:
ActivitySplashScreen (welcome to game, sign up for an account?)
ActivitySplashScreenSignUp (great, fill in this info)
ActivityGameMain (main game screen)
so the activities launch each other in exactly that order, when the user clicks through a button on each screen.
When the user goes from activity #2 to #3, is it possible to wipe #1 and #2 off the history stack completely? I'd like it so that if the user is at #3, and hits the back button, they just go to the homescreen, instead of back to the splash screen.
I think I can accomplish this with tasks (ie. start a new task on #3) but wanted to see if there was simpler method.
View 3 Replies
View Related
Feb 2, 2009
I am trying to launch an activity from another activity .. Within the com.android.SingleLauncher..
I have activity launch code as ..
CODE:...........
I have set the android:multiprocess="true" in the AndroidManifest.xml of TargetSL I don't seem to see the multiple instances of TargetSL, which i am expecting ..
All i see is 2 process, where i was hoping to see an instance of TargetSL, for each launch that was invoked by the singleLauncher!
View 3 Replies
View Related
Nov 16, 2009
I'm trying to figure out if there's any way to see if there is anything on the history stack so I can programatically display a Back button or not.
I tried getting the RunningTaskInfo to get the num of activities but it doesn't seem to work quite right for what I need. Does anyone know of another way?
View 2 Replies
View Related
Dec 4, 2009
Edit / Update:
As an update to the below problem, I found the exact action which causes it to happen.
Download an apk from a url through the android browser
Install the app.
After install, the app gives you two choices: "Open" or "Done".
If you choose "Open", the quirky behavior described below starts.
If you choose "Done", then launch the app from the app tray, it works fine.
So it seems like this problem is caused by using the "Open" button the browser provides you after installing the APK.
I'm experiencing an error in the history stack of applications upon first install. I made a test app to demonstrate this.
The test app is simply two activities, A and B. Activity A launches B. That's all it does. Rest is wizard generated template code from eclipse.
When the user installs the app (via web url apk), and runs it for the first time, I get an out-of-order activity stack:
-User starts the app, A is on top.
-They make A launch B by clicking a button. B is on top of the stack.
-User hits the home screen button.
-User returns to the app, A is displayed, instead of B.
-User hits the back key, B is shown!
-User hits the back key again, A is shown!
-User hits the back key again, home screen shown.
-Now the stack is clean, and app behaves "normally" from now on!
Is any one else seeing this? This is almost exactly like this known bug, however my users are not installing from eclipse:
http://code.google.com/p/android/issues/detail?id=2373&q=first%20%20i...
I can provide the test app/source if anyone wants to try. This is the manifest, which does not have any special customizations made to it. code...
as far as I know, this should definitely not be happening, and works fine after you clear the history stack the first time.
View 1 Replies
View Related
Oct 27, 2010
1. User click one button on Activity#1 to start Activity#2.
2. One button on Activity#2 start system default browser(Intent.ACTION_VIEW) to get Twitter authorized.
3. After user allow, Twitter redirect user to Activity#2(Custom intent- filter+data) and it save the tokens.
Now, if I press back key, the app back to browser, how to prevent this and return to Activity#1? Try several Intent.Flag before start browser with no luck.
View 4 Replies
View Related
Mar 17, 2010
Here's my use case: The app starts at a login screen. You enter your credentials and hit the "Login" button. Then a progress dialog appears and you wait for some stuff to download. Once the stuff has downloaded, you are taken to a new activity. Exactly which activity you are taken to depends on the server response.
Here's my problem: If you go HOME during this login/download process, at some point in the near future your download will complete and will invoke startActivity(). So then the new activity will be pushed to the foreground, rudely interrupting the user. I can't start the activity before I start the download, because, as I mentioned earlier, the activity I start depends on the result of the download.
I would obviously not like to interrupt the user like this. One way to solve this is to refrain from calling startActivity() until the user returns to the app. I can do this by keeping track of the LoginActivity's onStop() and onRestart(). But I'm wondering, is there any way to create the activity while it is in the background? That way the user returns to the app and he is ready to go. otherwise he would have to wait for the new activity to be created (which could take some time because the new activity also has to download and display some data). Update: Guess what? I LIED! I could have sworn that starting this activity was causing it to come to the foreground, but I went back to test it again and the problem has magically disappeared. I tested in both 1.6 and 2.0.1 and both OSes were smart enough not to bring a backgrounded task to the front.
View 2 Replies
View Related
Mar 26, 2010
If my app is already running, then either Activity1 or Activity2 might be currently on top. How to construct an Intent so that it will simply show whichever Activity is already on top (in the task)? Just like if you touch an icon in the Recent list (long-press home). At the moment, it looks like (for explicit Intents) you need to be explicit about the Activity to launch. But I would rather be explicit about the app (package name). FWIW, I'm thinking of Intents triggered via Notifications.
View 3 Replies
View Related
Jun 9, 2010
All activities in my application require a user to be logged-in to view. Users can log out from almost any activity. This is a requirement of the application. At any point if the user logs-out, I want to send the user to the Login Activity. At this point I want this activity to be at the bottom of the history stack so that pressing the "back" button returns the user to Android's home screen.
I've seen this question asked a few different places, all answered with similar answers (that I outline here), but I want to pose it here to collect feedback. I've tried opening the Login activity by setting its Intent flags to FLAG_ACTIVITY_CLEAR_TOP which seems to do as is outlined in the documentation, but does not achieve my goal of placing the Login activity at the bottom of the history stack, and preventing the user from navigating back to previously-seen logged-in activities. I also tried using android: launchMode ="singleTop" for the Login activity in the manifest, but this does not accomplish my goal either (and seems to have no effect anyway). I believe I need to either clear the history stack, or finish all previously- opened activities. One option is to have each activity's onCreate check logged-in status, and finish() if not logged-in. I do not like this option, as the back button will still be available for use, navigating back as activities close themselves. The next option is to maintain a LinkedList of references to all open activities that is statically accessible from everywhere (perhaps using weak references). On logout I will access this list and iterate over all previously-opened activities, invoking finish() on each one. I'll probably begin implementing this method soon.
I'd rather use some Intent flag trickery to accomplish this, however. I'd be beyond happy to find that I can fulfill my application's requirements without having to use either of the two methods that I've outlined above. Is there a way to accomplish this by using Intent or manifest settings, or is my second option, maintaining a LinkedList of opened activities the best option? Or is there another option that I'm completely overlooking?
View 2 Replies
View Related
Jan 6, 2010
I have three activities. Activity A start activity B by the method startActivityForResult, and Activity B start activity C by the method startActivity. Then, after starting activity C, activity B kill himself by finish(). Now the task stack stored two activities: A and C. My question is: how can I finish activity A when I finish activity C. or how can I clear the whole stack of the task.
View 5 Replies
View Related
Mar 14, 2010
I just started developing a simple Android application while I'm still learning its platform. I'm using Eclipse IDE with the ADT plugin 0.9.6 and I need to know if it's possible to view the activity stack that is associated with a Task. Is there any way through the DDMS tool or through any other technique?
View 4 Replies
View Related
Nov 15, 2010
Question related to Android Activity Restoration:
In my application there is a background Service from where I am launching Activities, Activity A and B. I am launching Activity A on some external events using "FLAG_ACTIVITY_NEW_TASK" (I need to use this flag to launch Activity A from Service, if did not then my application segments, Don't know why this happens) and Activity B without this flag. Activity Launching Sequence is as follows:
Service --> Activity B --> Activity A (With FLAG_ACTIVITY_NEW_TASK)
When we are in Activity A and we Hit Home key It returns to "Android Home" Screen and then after Selecting Application Icon, android does not launch Activity A again It displays Activity B. When we hit back key on Activity B it gets deleted (as it should) and then after Selecting Application Icon again It displays Activity A.
Why this might be happening? Have I explained it properly?
View 1 Replies
View Related
Jan 13, 2010
My application has two activities, that I start in this order: HOME > A > B Now I press HOME and launch "A" again. I would like to see activity "B" on a top of "A", but instead I get "A" - so the activity stack is cleared. Manifest: <activity android:name=".activity.A" android:label="A" android:always Retain Task State = "true">What should I do?
View 2 Replies
View Related
Jul 13, 2010
I have a app with 2 activities, A B A has a button that launches a new intent for B. When at B I press home, then launch app again, B is resumed with onResume(). But if after I press home, I use something like taskiller to clear tasks, then I launch app again, it still shows B, but onCreate() is called. What I want for the second situation is for the app to start A instead of B. How can that be done?
View 2 Replies
View Related
Feb 17, 2010
When the user press the home key, the onPause method is called. At this time, the application is supposed to save its state so it can be properly recovered later.
However, and if the state is taking too much time? For example, issuing a closeAllNetworkConnections that was waiting a feedback from the server, or just if the amount of information we're writting to disk is a lot of info... what would happen?
In my tests, i'm getting from 300-500 ms of time until the process is killed.
Is there a safer place to put a "save everything and quit" code so that it can safely save everything before a "kill the activity" task is issued?
View 3 Replies
View Related
Mar 24, 2009
I am just starting on an Android app and I am puzzled about why my Task activity stack is being reset any time the application is launched from the Home screen. I used the ADT tools to create the application in Eclipse. The main activity is ".UserLaunch" and it starts the activity ".About" when the user presses a button. If the user then presses HOME and then relaunches the app, .UserLaunch is displayed and is the only thing on the stack.
.UserLaunch has the launchMode singleTask. .About is standard. According to the documentation at http://developer.android.com/guide/topics/fundamentals.html#lmodes: "However, a "singleTask" activity may or may not have other activities above it in the stack. If it does, it is not in position to handle the intent, and the intent is dropped. (Even though the intent is dropped, its arrival would have caused the task to come to the foreground, where it would remain.) "The Task stack should be brought to the foreground and .About should still be displayed. I added Logging to all of the lifecycle events (edited to remove timestamps and shorten DEBUG/ and INFO/ to D/ and I/) and you can see that when HOME is pressed, .About cycles through onPause and onStop (as expected). Then when the app is again launched, .About is destroyed and .UserLaunch is restarted D/UserLaunch:(670): onCreate() D/UserLaunch:(670): onStart() D/UserLaunch:(670): onResume() I/ActivityManager(52): Displayed activity com.cequint.cityid/.UserLaunch: 4910 ms I/ActivityManager(52): Starting activity: Intent { comp= {com.cequint.cityid/com.cequint.cityid.About} } D/UserLaunch:(670): onPause() D/About(670): onCreate() D/About(670): onStart() D/About(670): onResume() I/ActivityManager(52): Displayed activity com.cequint.cityid/.About: 1031 ms D/UserLaunch:(670): onStop() I/ActivityManager(52): Starting activity: Intent { action=android.intent.action.MAIN categories= {android.intent.category.HOME} flags=0x10200000 comp= {com.android.launcher/com.android.launcher.Launcher} } D/About(670): onPause() D/About(670): onStop() D/dalvikvm(670): GC freed 413 objects / 34128 bytes in 72ms I/ActivityManager(52): Starting activity: Intent { action=android.intent.action.MAIN categories= {android.intent.category.LAUNCHER} flags=0x10200000 comp= {com.cequint.cityid/com.cequint.cityid.UserLaunch} } D/About(670): onDestroy() D/UserLaunch:(670): onRestart() D/UserLaunch:(670): onStart() D/UserLaunch:(670): onResume() Here is the relevant section of the Manifest: <application android:icon="@drawable/icon" android:label="@string/ app_name"> <activity android:name=".UserLaunch" android:label="@string/app_name" android:launchMode="singleTask" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name=".About" android:launchMode="standard"> </activity> </application> Anyone have any ideas why this is always resetting the Activity Stack?
View 11 Replies
View Related
Aug 29, 2010
I just want to know how detect that the activity or service has been killed by the advanced task killer? I was expecting the onDestroy method to be called, but it doesnt!
My app starts the background service on boot. The activity is not started except from menu. But its name appears in the advanced task killer list. When I try to kill it, it doesnt call the onDestroy method neither the service's.
View 1 Replies
View Related
Sep 23, 2010
I have a very simple android project. I got the following error message when I try to run it. The emulator is running but the application doesn't come up. I couldn't find any useful information online.
CODE:..................
View 3 Replies
View Related
Aug 4, 2010
Say that the user has started my App and then switched off to use the Browser (so we have 2 sets of Tasks running). After a while, something happens to my app that requires the user's attention, so it posts a notification to notify the user. Is there a way to bring my App's task (and the Activity on top of the stack) out from the background when user clicks on my notification?
View 2 Replies
View Related
Aug 19, 2009
Our application is defined to launch a SplashScreenActivity from Intent { action=android.intent.action.MAIN categories= {android.intent.category.LAUNCHER} . After the SplashScreenActivity does its work, it launches another intent to launch MainMenuActivity and finish() is called on SplashScreenActivity.
When we run our app for the first time on our phone, the SplashScreenActivity launches OK, and correctly launches the MainMenuActivity.
However, if we kill the app using TaskKiller, LOGCAT indicates that the application has been killed. I can't debug the app, because launching it from eclipse with the debugger makes it work OK, because it reinstalls the app. Perhaps there is a way to launch the app without reinstalling it?
Here is the Log of us killing our app...
When we launch the application again, the LOG messages for SplashScreenActivity are not logged and it looks from LOGCAT that Android is launching the MainMenuActivity instead. Here is the log...
Can someone Romaine, Diane help us understand what is happening? We saw this happening because some variables are initialized in SplashScreenActivity that aren't available with MainMenuActivity and we were getting NPEs.
View 3 Replies
View Related
Aug 13, 2010
Is it possible to start an activity on the stack, clearing the entire history before it? The situation I have an activity stack that either goes A->B->C or B->C (screen A selects the users token, but many users only have a single token). In screen C the user may take an action which makes screen B invalid, so the application wants to take them to screen A, regardless of whether it is already in the stack. Screen A should then be the only item on the stack in my application. Notes There are many other similar questions, but I haven't found anything that answers this exact question. I tried calling getParent().finish() - this always results in a null pointer exception. FLAG_ACTIVITY_CLEAR_TOP only works if the activity is already on the stack.
View 1 Replies
View Related
Sep 26, 2010
How do I close a whole hierarchy of activities and show a new activity not present in the current task?
Context
Consider a FTP browser that resumes the previous session on launch. Each folder is displayed in its own activity. When I click on a folder, a new activity is started for the folder. If I press the back button, the app returns to the previous activity, which corresponds to the the parent folder.
I can logoff from the menu at any time. Logging off should bring me to the login activity (not present the current task when the app has resumed the session), and close all the other activities. How can I do this?
From what I've read, if the activity were in the current task I could use FLAG_ACTIVITY_CLEAR_TOP in the intent, but this is not my case.
View 1 Replies
View Related
Aug 25, 2010
CODE:..........
Here is the code where the problem lies....
It doesn't give me an error it says exactly this when I run the android emulator
"[2010-08-25 09:12:42 - doppler_test] ActivityManager: Warning: Activity not started, its current task has been brought to the front"
What I think this means is that the intent of the bluetooth function and the button intent is only operation on a hierarchy system. What I mean by this is that if I were to move the button opperator above the Bluetooth stuff the button will work, but currently when the app is run Bluetooth works but when I press the search button nothing happens.
What else may be helpful is my XML code for the button so here it is......
CODE:..........................
View 1 Replies
View Related
Nov 2, 2010
I want to display a splash screen followed by my trial.class.I am not getting any error but warning as:
Warning: Activity not started, its current task has been brought to the front
I have different-2 approches for this each time this warning is being displayed.
CODE:.....................
View 8 Replies
View Related