Android :: Avoiding Activity Stack Overflow
Sep 17, 2009
I have the following situation. I have a task with the following activity stack -- A - B - C I have a menu item that allows me to start activity D; so my activity stack looks like this -- A - B - C - D Then I could select a menu item that allows me to start an activity C, which would cause my activity stack to look like this: A - B - C - D - C Then I could go back (via the menu item) to activity D, making my activity stack look like this: A - B - C - D - C - D Doing this a few more times, it would wind up looking like this -- A - B - C - D - C - D - C - D - C - D - C - D - C - D - C - D - C - D - C - D - C - D This seems kinda stupid to me. I'd like it to simply re-use an activity, or pop the activity below to be on top (which goes against the nature of a "stack"). So, what I mean is if I had this activity stack: A - B - C - D And I started activity C (from the menu), I would get: A - B - D - C And if I then started activity D (from the menu), I would get: A - B - C - D Is there a way to do this without keeping some global list of activities and doing gross things to them to reorder them?
View 3 Replies
Nov 8, 2009
I'm trying to make a horizontal layout with two TextViews, one should take up 40% of available width, the other 60%. This works unless the text is longer than available space, then a stack overflow exception is thrown. Pasting this into an empty 1.5 project xml file should cause it (though this seems to work ok on 1.6+):
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/ android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:weightSum="100" >
<TextView android:layout_width="0dip" android:layout_height="wrap_content" android:layout_weight="40" android:text="Some really long sentence AAAAA" android:singleLine="true" />
<TextView android:layout_width="0dip" android:layout_height="wrap_content" android:layout_weight="60" android:text="Some really long sentence BBBBB" android:singleLine="true" /> </LinearLayout>
Is there some other way to do this? I need to just break a row up into these separate columns with specific widths. I'm ok with the text just getting truncated on overflow,
View 5 Replies
View Related
Dec 16, 2009
I tried to create the launcher widget for getting some messages from social networking server. I hope it can support autoLink feature of these message content. however, it will have the "Stack Overflow exception" when android:autoLink="web|email" is enabled when getting more than 20 messages. this issue doesn't happened when I remove this parameter. would you please share your experience about this issue?
View 2 Replies
View Related
May 11, 2010
I could not find a Stack Overflow notifier Android app so I am planning on making one. I hope that my app will serve a similar purpose as the Stack Overflow Notifier Chrome extension. This will be my first Android app so I am still unfamiliar with the platform.So I currently plan to ask the user to login by bringing up a WebView and then access the Recent Activity page in the background at specific intervals.My question:How can I store the authentication cookie from StackOverflow after the user has logged in through the WebView and then send this cookie in the HttpGet request when accessing the Recent Activity page?
View 1 Replies
View Related
Aug 17, 2010
Got a trace like this:
java.lang.StackOverflowError
at android.widget.TextView.onMeasure(TextView.java:5160)
at android.view.View.measure(View.java:8172)
at android.widget.TableRow.getColumnsWidths(TableRow.java:308)
at android.widget.TableLayout.findLargestCells(TableLayout.java:497)
at android.widget.TableLayout.measureVertical(TableLayout.java:462)
at android.widget.TableLayout.onMeasure(TableLayout.java:428)
at android.view.View.measure(View.java:8172)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3140)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1012)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:381)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:304)
at android.view.View.measure(View.java:8172)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3140)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1012)
at android.widget.LinearLayout.measureHorizontal(LinearLayout.java:696)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:306)
at android.view.View.measure(View.java:8172)
at android.widget.ListView.measureScrapChild(ListView.java:1135)
at android.widget.ListView.measureHeightOfChildren(ListView.java:1200)
at android.widget.ListView.onMeasure(ListView.java:1109)
at android.view.View.measure(View.java:8172)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3140)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1012)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:381)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:304)
at android.view.View.measure(View.java:8172)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3140)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)
at android.view.View.measure(View.java:8172)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:526)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:304)
at android.view.View.measure(View.java:8172)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3140)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)
at android.view.View.measure(View.java:8172)
at android.view.ViewRoot.performTraversals(ViewRoot.java:805)
at android.view.ViewRoot.handleMessage(ViewRoot.java:1744)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:144)
at android.app.ActivityThread.main(ActivityThread.java:4937)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
at dalvik.system.NativeStart.main(Native Method) Is there anything that can be done here? I'm getting reports of blank screens and force closes.
View 1 Replies
View Related
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
Sep 29, 2009
I want to avoid softinput specifically in one activity in a very specific case.
When i *long press "menu" button *softkeypad is coming irrespective of the activity.
How can i avoid this? i have tried "stateAlwaysHidden" etc for that activity. But did it work.
Al other cases ok. Just this case* long press "menu" button*.
View 6 Replies
View Related
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
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
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
Feb 24, 2010
I am currently showing a notification. When the user clicks this noticiation, the application is started. The notification persists, to indicate that the service is running in the background.
CODE:..............
However, I have detected a case where a bug appears. If the user starts the application through clicking the normal icon, and while the activity is running clicks the notification, then a new activity is started without the earlier one exiting, the later being on top of the earlier. And that is not all: Further clicks on the notification will create additional activities and place them on top of those already running. How can I prevent this? Is there a nice check to do to see if a certain activity is currently being shown or is loaded?
View 1 Replies
View Related
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
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
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
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
Mar 19, 2010
I would like to pausing or putting the application on background when pressing the back button, I don't want the application to go through the destroy state. Things are when I override onKeyDown and when I force to pause or stop the application by using onPause, I have some issuees with the wakelock and application crash, but when I press home button I go through onPause method and I have no exception, it's weird!
View 1 Replies
View Related
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
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
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
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
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
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
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
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
Dec 15, 2009
Actually I was trying to automate some stuff on my android emulator. I start an activity through adb shell using "am" command, but when the activity starts do I have a way out to know that my activity is the one which is at the top & has the focus.I googled about it a lot but couldn't find the right way to do this.
View 2 Replies
View Related
Dec 3, 2009
I'm having trouble with my activities when they go in the background. I have two activities, A and B. Only A can launch B (manifest copied below).This is very confusing. It's like Android knows my app is running, and puts a new instance of A on top of the old B instance running. I'd just expect that the application gets paused in-place, and whenever the user hits the app icon again, it just picks up where it left off (in this case, just show B again!) Below is the manifest, and the activity classes for this test are completely empty (except A which has a button to launch B).
View 4 Replies
View Related
Jun 16, 2010
My app has a single entry activity called "Main". In "Main" I call one of three other activities A, B, or C (based on a preference) and then immediately exit/finish"Main" so that only A, B, or C are active.I also have a permanent notification in the notification bar that users can pull down (at any time) to conveniently restart my App (calls intent with "Main" component).The problem is that if my app is already running and users pull down the notification and restart, I get A or B or C running on top of the previous activity (also A, or B, or C). How can I avoid this (i.e. reuse the activity on top of the stack)?I've tried Intent.FLAG_ACTIVITY_* and nothing seems to work. I've tried launchModel in the Manifest and it also didn't seem to work.
View 1 Replies
View Related
Sep 8, 2010
I have pushed one Activity to make few changes. Now I want to pass all the changes to the previous(below) Activity. I dont want to create Activity again;and intead i want to access the previous activity.
View 1 Replies
View Related
Apr 7, 2010
Is there a way to vizualise the activity stack, at some moment during debug, or normal run ?
View 3 Replies
View Related
Apr 7, 2010
Android - Can I force BACK button to go 2 steps back in the Activity stack with some kind of code? I know I can override the onKeyDown method but I want BACK to do it's thing, just twice!
View 3 Replies
View Related