Android :: Way To Visualize Activity Stack (activities In Memory) On Droid?

Jun 26, 2010

I'm currently debugging my app which is quite complex and has up to 5 activity levels. In order to detect memory leaks (i.e. activities that aren't removed from memory even finish() is called, due to some references held somewhere) I want to check which activities are still alive in memory. Currently I create hprof dumps, but it's not very convenient, cause every time I need to mount the sdcard, copy the hprof dump file from the sdcard to my PC, etc. (Side note: I already tried to automate the pulling of my hprof file more easily, but I'm on an unrooted device and adb pull <hprof file> won't let me / no permission.) Therefore I am wondering, if all I want to know is IF and WHICH activities are still currently alive in my memory, is there a way through the Android API or any other way on-the-fly with which I can achieve this (list all alive activities of my app), programatically.

Android :: Way to visualize activity stack (activities in memory) on droid?


Android :: How To Keep Track Of Activities In Activity Stack

Aug 23, 2010

I need to keep track of currently existed Activities in Activity stack.

Can any one help me in that how to do it programmatically?

View 1 Replies View Related

Android :: Kill Sub Activities And Bring Activity To Top Of Stack

Aug 4, 2010

I have activity A that starts activity B which starts activity C

A -> B -> C

When a user clicks on a button in activity C, i want to bring A to the top of the stack and take B & C completely out of the stack. Is there a way to do this ? ?

View 2 Replies View Related

Android :: How Do I Clear All Activities From Stack?

Jul 8, 2010

I am having trouble popping all activities off the stack using ntent.FLAG_ACTIVITY_CLEAR_TOP and android:launchMode="singleInstance". In my application activity A, launches activity B (via startActivity) which in turn launches activity C (via startActivity). On activity C the user presses a menu item to return to activity A. When they arrive at activity A, I want only A on the stack such that if they click the back button they return to the home screen (desktop). This is the code that I am currently using when the user presses a button to return to A: Intent i = new Intent(this, A.class); i.addFlags(Intent.FLAG_ ACTIVITY_ CLEAR_TOP); startActivity(i); All activities are defined as android:launchMode ="single Instance" in the project manifest. My code doesn't seem to work though. Once I'm back on activity A if I click the back button I return to activity C. Am I misunderstanding how to use Intent.FLAG_ACTIVITY_CLEAR_TOP?

View 2 Replies View Related

Android :: How To Reopen A Stack Of Activities?

Sep 3, 2010

My App is Launched by "Main.java" (Activity) and opens a Notification and a second Activity called "Sub.java", now I press the Home-Button and the App disappears (everything okay until here). If I'll now click on the Notification the "Main.java"-Activity is launched, the "Sub.java" seems to be lost. Is there any possibility to reorder the Stack of Activities to the front?

View 1 Replies View Related

Android :: Stack Of Activity From Activity Stack

Nov 2, 2009

There is a stack of activity i want to call the activity from that stack , My question is that is it possible to check from that stack and call that intent.When i press home button and again when i press the executable it should start the activity where i have left .Is it possible?Any example related to the same would be great help

View 3 Replies View Related

Android :: How To Clear Current Activities In Stack?

Jul 26, 2010

Support App starts activity A, then A starts activity B and finishes itself. After that activity B starts activity C. Now the stack contains B and C, with C at the top. Then I click a button in activity C, and want it to clear B and C and start activity A, i.e. I want activity A to be the only activity in the stack. How can I make it?Edit: I made a test to use FLAG_ACTIVITY_CLEAR_TOP. But it didn't work in my case, because activity A is not running when button in activity C is clicked.

View 1 Replies View Related

Android :: Way To Manipulate The Droid Activity Stack?

Jun 23, 2010

1 - User opens app for the first time ever from android home screen User is presented with "first time" screen (backed by first time activity, lets call it A) User hits back button user is returned to android home screen 2 - User opens app for second time User is presented with the main list screen of the application (backed by a list activity, let's call it B) User hits back button User is returned to android home screen I'm already aware of numerous ways to detect whether it's the first time opening the app or not. The problem is in having the back button return to the home screen rather than a routing activity that decides which screen to forward to.

View 1 Replies View Related

Android :: How To Limit Number Of Same Activity On Stack For Droid App?

May 10, 2010

Is this possible in an Android app? I want to make it so that no matter how many times a user starts activityA, when they hit the back button they will never get more than one occurence of activityA. What I am finding in my current code is that I have only two options 1. I can call finish() in activityA which will prevent it from being accessible via the back button completely, or 2. I do not call finish(), and then if the user starts activityA (n) times during their usage, there will be (n) instances when hitting the back button. Again, I want to have activityA accessible by hitting the back button, but there is no reason to keep multiple instances of the same activity on the stack. Is there a way to limit the number of instances of an activity in the queue to only 1?

View 2 Replies View Related

Android :: How To Detect If Current Stack Of Activities (task) Moves To Background?

Jul 23, 2010

The official documentation describes tasks as follows: All the activities in a task move together as a unit. The entire task (the entire activity stack) can be brought to the foreground or sent to the background. Suppose, for instance, that the current task has four activities in its stack three under the current activity. The user presses the HOME key, goes to the application launcher, and selects a new application (actually, a new task). The current task goes into the background and the root activity for the new task is displayed. Then, after a short period, the user goes back to the home screen and again selects the previous application (the previous task). That task, with all four activities in the stack, comes forward. Is there a way to programmatically detect when the task of the current Activity moves into and out of the background? I would like to know when the user has switched switched to another application, vs. when the user navigated to another Activity in the current app.

View 2 Replies View Related

Android :: How To Access Droid Activity Stack From Asynchronous Thread?

Sep 26, 2010

There are a ton of activity stack related questions on StackOverflow, but I didn't really see any that answered the question I have. I'm working on an online game that (for now) has 3 different activities Login/Register Menu (seen when logged in, includes "new game", "my stats", and a few other things...I'm just worried about the "new game" option for now.

View 1 Replies View Related

Android :: How To Clear Activity Stack If Using Same Activity Multiple Times?

Mar 3, 2010

So I have an app with Activity A. The layout on the activity is dynamic genearted. So it's possible that on Activity A a user hits a button that goes to "A" and the new page looks different, then a user clicks another button to go to "A" again. Now I have 2 Activities in the history stack. A, A, and currently on A. Is it possible that if a user clicks a button that the whole Activity stack is cleared in a scenario such as this?

View 5 Replies View Related

Android :: Finish Any Previous Activity In Stack From Current Activity?

Apr 27, 2010

How to finish any previous activity in application stack (at any level , I mean not immediate parent) , from current activity like on some particular event I want to invalidate this previous activity?

View 1 Replies View Related

Android :: Retain Only One Copy Of An Activity On Stack When Called From Non Activity

Jul 26, 2010

How can I make sure I only retain one copy of an activity on the stack when called from non-activity? When called from an activity I can just add the FLAG_ACTIVITY_REORDER_TO_FRONT flag to the Intent, but how can I do this from e.g. a widget or a notification?

View 1 Replies View Related

Android :: Way To Skip Parts Of An Activity Stack When Returning Results In Droid?

Oct 16, 2009

I'm making an app which has a flow roughly as below: User starts on the main screen with an empty list, hits menu, and goes to "add item." (Activity A) User is given a new activity which allows them to specify search criteria, then hits "go" to do a search. (Activity B) User gets a list of results, and can click on one of them to view more details. (Activity C) User sees details of item, and can use a menu item to save it to their list in Activity A. (Activity D) Right now, I am having each Activity call each other Activity for results, and then it is passing the result all the way back up the stack as it returns to Activity A. Is there a way to jump this, since all I want is for a result in Activity D to get to Activity A directly? Note that a user should still be able to navigate backwards (using the back button) through each activity, but if they explicitly save the item in Activity D, I want it to jump straight to Activity A.

View 2 Replies View Related

Android :: How To Clear All Activity In Stack Below Latest Activity?

Dec 22, 2009

All the current discussions involves clearing all activites above an existing activyt, but I'm trying to find a way to clear all the activities before the latest activity in the stack. So my scenario is A -> B -> C and then when a user goes to Activity D, activies A,B,C should be cleared from the activity stack. FLAG_ACTIVITY _CLEAR_TOP seems to only clear any activites above an existing activity. Anybody run into this scenario and found a solution?

View 4 Replies View Related

Android :: Clear Activity Stack And Replace With A New Activity

Sep 17, 2009

i want to clear the activity stack and replace it with a new activity as the root activity, even if that activity exists somewhere on the stack (or not). i see FLAG_ACTIVITY_CLEAR_TOP and FLAG_ACTIVITY_NEW_TASK, but it's not obvious to me how to use those in conjunction to achieve what I want. it's like i want to completely restart the task with some activity that i specify as the new root.

View 9 Replies View Related

Android :: Make A Particular Activity As A Root Activity In Stack

Aug 4, 2009

i have a set of activities on my stack Say A-->B-->C. when i launch the activity named 'D' it should get fired as the root activity of my application and all the other activities(A,B,C) should get cleared from my stack once Activity D is launched.Can any one tell me as how to do this

View 4 Replies View Related

Android :: Strange Activity Stack Behavior When Using Map Activity

Apr 23, 2010

I have the following activity structure in my application A simple "splash screen" activity is started when the application is fired up (let's call it "Splash"). This activity starts the main activity when the user presses a button (I will call it "Main"). Main can in turn start two activities from the menu. The first activity presents a simple form (let's call this one "Form"), the second is a MapActivity that presents a map (it is called "Map").
Main, Form, and Map are declared exactly the same in the manifest:
<activity android:name="fully qualified activity class"
android:screenOrientation="landscape"
android:configChanges="keyboard|keyboardHidden|orientation"
> <intent-filter>
<action android:name="android.intent.action.DEFAULT" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter> </activity> When Main is active and I start Form and press "back", Main comes up again. Pressing "back" again brings up "Splash". Nothing strange here.Now comes the strange part: when I am in Main, start Map, and press "back", Main comes up as expected. But pressing "back" again just restarts Main. A second press on "back" is needed to bring me back to Splash!So it seems that starting the Map activity somehow results in Main ending up on the activity stack twice while starting the Form activity does not! Both Form and Map are started like this: start Activity(new Intent(this, MyActivity.class)); I don not catch the back key in any activity.Any clues on what is going on or how to debug this?

View 1 Replies View Related

Android :: Best Tool To Visualize Droid Project?

Nov 15, 2010

Can anyone suggest me a good tool to quickly understand a reasonably big Android project: the class hierarchies, relations and methods via some visual means? Is some kind of plugin available that we can point it to the android project and it would create a package diagram? I know a bit about "yDoc" & "ObjectAid"

View 3 Replies View Related

Android :: Closing More Than One Activity In Activity Stack

Nov 4, 2009

I'm new android and i want to know how to remove more than one activity from stack. We use finish() for closing particular activity but i wanna close more than one activity underneath it, at a time.

View 2 Replies View Related

Android :: Leads To Theorize That Memory Is Leaking On The Stack

May 7, 2010

I'm writing an app that has a foreground service, content provider, and a Activity front end that binds to the service and gets back a List of objects using AIDL. The service does work and updates a database.

If I leave the activity open for 4-8+ hours, and go to the "Running Services" section under settings on the phone (Nexus One) an unusually large amount of memory being used is shown (~42MB).

I figure there is a leak. When I check the heap memory i get Heap size:~18MB, ~2MB allocated, ~16MB free. Analyzing the hprof in Eclipse MAT seems fine, which leads me to theorize that memory is leaking on the stack. Is this even possible? If it is, what can I do to stop or investigate the leak? Is the reported memory usage on the "Running Services" section of android even correct (I assume it is)?

Another note: I have been unable to reproduce this issue when the UI is not up (with only the service running)

View 1 Replies View Related

Android :: How To Clear Android Stack Of Activities?

Nov 16, 2010

Hi I have an application with several Activities in Android and I want the user to be able to log out by pressing a menu button. The problem I have is that A) Android doesn't let you terminate the applications and B) even when I send the user to the Login Activity again they can always press back and get right back to the previous activity they were in.I already tried to launch the Activity with the two following flags:
Intent intent = new Intent(this, LoginActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
I also tried with each one of them by themselves. I also tried calling finish() after startActivity(intent) as I read in another StackOverflow

View 2 Replies View Related

Android :: Clear Activity Stack?

Nov 3, 2009

Is there a way to clear our Activity stack? For example, a user in my app progresses through these activities, one is launched from the previous activity: ActivityA -> ActivityB -> ActivityC if the user is now looking at ActivityC, and they hit the back button, they will go back to ActivityB. Is it possible to add a menu to ActivityC where the user can clear their activity stack, and then launch a new instance of ActivityA? This would be so the user can jump to a particular activity in my application without getting confused with the back button + history,

View 4 Replies View Related

Android :: Activity Stack Not Preserved

Mar 10, 2010

My main activity A has as set android:launchMode="singleTask" in the manifest. Now, whenever I start another activity from there, e.g. B and press the HOME BUTTON on the phone to return to the home screen and then again go back to my app, either via pressing the app's button or pressing the HOME BUTTONlong to show my most recent apps it doesn't preserve my activity stack and returns straight to A instead of the expected activity B.Is there a setting I'm missing or is this a bug? If the latter, is there a workaround for this until the bug is fixed?

View 5 Replies View Related

Android :: Way To Navigate Up Activity Stack?

Sep 20, 2010

My understanding is to quit the app I need to call finish() on all activities up to the root activity. However, how do I navigate up activities in app activity stack from current active activity?

View 12 Replies View Related

Android :: Traversing Activity Stack

Sep 1, 2010

how can I assure I always go back clicking on custom menu option to previous activity. I think it is a good idea to start new activities by startActivity(context, XActivity.class) but then when option is selected I should call finish on that activity or again call startActivity(this, previousActivityName)?on the other hand android has all activities on a stack so clicking goback button on a phone I will always go back to previous view, so how can I get this stack.

View 6 Replies View Related

Android :: Removing Stack Of Activity

Jan 7, 2010

I have 5 Activities in sequence Activity1, Activity2, Activity3, Activity4, Activity5.When I am at Activity5 there is a button through I can go to Activity2.Means jump from 5 to 2 with removing the Activity3 & 4.How can I do that?

View 7 Replies View Related

Android :: Resetting Activity Stack

Sep 22, 2009

Activities: A & B are activities that once you have navigated away from them it's not logical that you can get back to them using the back button. C X are activities that follow the usual "can go back to where you came from" flow.App flow: * Launch app from Home -> starts A * From A start B * Finish A (removes it from stack) * From B start C * Finish B (removes it from stack) * From C start D * From D start E.Once the user has reached E, the activity stack looks like this: C -> D -> E. Can I somehow reset the whole stack so it starts again at A so it's as the user just launched it from Home (so that C... E are removed from the history stack)?

View 3 Replies View Related

Android :: Activity History Stack

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







Copyrights 2005-15 www.BigResource.com, All rights reserved