Android :: Possible With One Call To Finish All Previous Activities?
May 30, 2009
Is it possible with one call to finish all previous Activities. (like: this.finish(all) :)
I have a main activity, calling a preferences and there is a switchuser point that switch the user and call the main activity again. But than i don't need that the user can go back, step by step, It would be just fine i could say "kill all previous activities" in the moment the user click "switch user".
View 7 Replies
Oct 26, 2009
I have an android application with a LOT of activities, think of something like a book where every page is a new activity. The user can make changes in each activity, for example highlight certain texts with different colored markers etc. and it's crucial that I'll remember this information as long as the application stays alive (and I don't want/need to remember any of this when it's not). As I understand the best mechanism for storing this kind of information is via onSaveInstanceState(Bundle outState) and onCreate(Bundle)/onRestoreInstanceState(Bundle) rather than lets say, the Preferences mechanism. My only problem is that the user can navigate backwards to previous pages (Activities) and the only way i know of achieving this is by calling finish() which of course kills the current activity without calling onSaveInstanceState(Bundle outState) and even if it did call it, the next time I would launch an activity representing that page it would be an entirely new instance. So my question is: Is there a way to go back to the previous activity without calling finish()? or, is there a better way to save this information? maybe through static variables?
View 1 Replies
View Related
Mar 30, 2010
I have an activity that launches another activity with startActivityForResult method. I would like to terminate the called one programmatically but I don't know how to do this since in onActivityResult() method I have no information about the called activity and I cannot call finish() on it. How can I achieve this?
View 4 Replies
View Related
Apr 8, 2010
I am trying to make an exit button for my application. Anyhow I am able to track all the instance of activity in my application and then finish them all. But still some activity remain alive in some cases. Dont know how. Is there any method to kill a particular application in android. Or any other way can I exit from my application.
View 1 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 15, 2010
When i leave my app after pressing home button and then re launch it from menus it behaves in a strange way.Sometimes it launches the same activity on which i pressed home button.But sometimes it launches the first activity of my app. One reason for this could be that whenever system has memory shortage it clears any activities existing in But the strange thing is if i press back button from first activity it takes me back to the same activity on which i pressed home button and all other previous activities are also there(like if i press back button again previous activities also exist.)I haven't set any launching mode for any activity in my app(like single instance etc).What i don't need is that previous activities load on pressing back button on first activity.
View 2 Replies
View Related
Sep 10, 2010
I have an activity that after some user interaction calls finish() on itself. From time to time it gets into a loop where when it calls finish() it finishes but immediately restarts again. Any idea why android tries to restart my activity?
View 3 Replies
View Related
Jul 11, 2013
Here's the thing, someone called me today and during the call I pressed a few numbers, then the call ended before I could save them somewhere. Is it possible to find them somewhere?
View 2 Replies
View Related
Nov 23, 2009
When I finish a call on my Droid it displays the "cute" little android dude and seems to always have a Cadillax CRX/Google Advert. Anyway to change the pic. I found an app that shows constellations instead but I wonder if this is something I can just do myself? And why are there adverts, it doesn't really bother me but I didn't get some special deal on the phone so why should I be forced to see the Advertising? Oh I just had a thought - is this a result of using google voice?
View 5 Replies
View Related
Aug 14, 2010
With this sample code, the activity is told to finish, but continues execution afterwards and displays the message. I'm trying to understand why this happens. The only fix I can think of is to place 'return' after finish.
public void someMethod() {
if( valueIsTrue) {
startActivity(new Intent(this, NewActivity.class));
CurrentActitivy.this.finish();
// return; // if uncommented, Toast doesn't show
}
Toast.maketext(this, "Some message", Toast.LENGTH_SHORT).show();}
View 1 Replies
View Related
Aug 12, 2010
There is a "switch calls" button when I answer a call on call waiting, but is there any way to switch to the previous call, hang up, and come back to the new call? I tested it today and I hung up on everybody.
View 1 Replies
View Related
Nov 23, 2010
I have just purchased the X10 and unfortunately when making a call I cannot end the call by tapping the end call button or call the dialer up to select options.The only way I can hang up is by pressing the power button at the top.I have looked at various forums and they comment how sensitive the end call button is and it can be easily knocked by a chin but not in my case.Does anyone have any ideas?
View 2 Replies
View Related
May 8, 2010
Say I have 2 activities (ActivityOne and ActivityTwo). How would I call ActivityTwo from ActivityOne? Then how would I return to ActivityOne from ActivityTwo? For example, I have a listview with all the contacts on the host phone. When I tap on a contact, another activity shows information and allows editing of that contact. Then I could hit the back button, and I would go back to the exact state that ActivityOne was in before I called ActivityTwo. I was thinking an Intent object, but I am not sure. Could someone post some code?
View 2 Replies
View Related
Dec 29, 2009
I currently have widget for my app Hire*A*Droid bundled with the main application. I would like to unbundle the widget and release it as a separate offering. However - the widget is relying on Activities from the main app so I need to navigate between these two mainly calling particular Activity of the main app from the widget. So the basic idea - app can work without widget and the widget becomes the "add-on" option.
What is the "right" way to call app activities from the stand-alone widget? Do I convert the main app into a content provider? Can you point me to any code samples perhaps?
P.S. I'm not asking how to call Activities from the widget that is bundled in the same APK. The question specifically states that widget is distributed separately from the app it's calling
View 1 Replies
View Related
Jun 30, 2010
how to call BarCodeScanner, and return the value to a field.so now, i have a toast that says "successful scan" and then i want to pass the result to a new activity. when i comment out my intent, everything works (minus the passing of data/switching of screen, obviously) but when i run my project as is, it FC's no errors reported by eclipse in code or xml. any insights?
View 2 Replies
View Related
Aug 16, 2010
We all know that hitting the back button on the device doesn't kill the application, it merely finishes (destroys) the activity running on the foreground.
Well I have come across some code which helps me capture the back button signal so that I cannot exit the application. The only way to exit it in such cases is to press the home key.
Now this situation presents me with a unique disadvantage! The inability to kill finish the application on a time of my own choosing allows the application to keep running in the background like nothing has changed.
So in such cases is the task manager my only friend or is there a way for me to otherwise kill this application?
View 2 Replies
View Related
Nov 30, 2009
I see no means by which my activity can pop itself off the activity stack to return the user to the one he was using before it was invoked. Is there one? My purpose is that my app has some data structures built from data provider queries that take 5-15 seconds to assemble and I don't want a lot of latency if it is used in a few one-shot purposes in rapid succession. I'm more than willing to let the system ask my app to die, but I'd like to keep warmed and ready otherwise.
View 4 Replies
View Related
Sep 7, 2010
I have one activity call a camera view activity, and in the onActivityResult, I have it start that activity again with different parameters. Android doesn't seem to like that, and gives me an error that the camera is not available if I start it right after it returns. I tried just waiting a few seconds, but this doesn't seem to work on all phones, and it sometimes crashes. Is there some way to wait until that activity finishes properly, and gives up all resources?
View 6 Replies
View Related
Apr 12, 2009
I've got an application that has (among other things) three Activities, let's call them A, B, and C. A is the main navigation point for the entire application, and launches B and C directly using startActivity(). They work fine that way. However, when I call C from inside B, I get a strange problem. The code for launching Activity C is exactly the same in both places. The problem is the hardware back button. In the emulator, it takes two presses of the back button in order to close Activity C and come back to B. On a G1, it takes 3 or 4 presses. Upon seeing this, I implemented the usual suspects in C - onPause(), onStop(), and onDestroy(), and onResume() in B. When I press the back button from C and it doesn't work, I get onPause(), onStop(), onDestroy () - in that order, but nothing happens. When it works (on press 3 or 4 on the G1), I get onPause(), then onResume() in B, then onStop() and onDestroy().
I've tried catching the key press of the back button and calling finish (), but that doesn't make a difference. Has anyone seen this? To pre-empt some questions: All C does is display some data. There are no threads or any other special resources that C might have an active handle to that's preventing it from closing. But out of curiosity, if it did, how would I detect that? Any ideas for further diagnostics here?
View 12 Replies
View Related
Jul 23, 2009
I have an EditText field and I want to pop up a new window/activity whenever a user touches/clicks the field. The new window has some widgets and of course Apply and Cancel buttons. Here is the code how I intercept the onTouch event.
EditText ctlMaskEt = (EditText)findViewById(R.id.mask_field); ctlMaskEt.setOnTouchListener(new OnTouchListener() { public boolean onTouch (View v, MotionEvent event) { popMaskEditor(); return true; } });
Everythings work fine until I click the Apply and Cancel buttons. The API finish() won't close the new window unless I click the same button one more time. Calling popMaskEditor() from a button's OnClick event handler doesn't have this problem.
View 2 Replies
View Related
Sep 16, 2009
I had the 1.5 android emulator starting from Eclipse perfectly nicely.... until yesterday when it suddenly won't finish booting. I haven't installed anything new (Running it on Windows Vista - i know, uck, but I'm waiting for Win 7 to hurry up), haven't even changed the java code I am trying to run. The emulator starts up, get's to the point where it shows "Android" with the nice lighting effect that goes from left to right over it and then just stays in that state. Last night I tested it by starting it up, going out to the living room, watching two hour long episodes of the first series of Doctor Who, and then coming back in (Essentially giving it 1.5 hours to do it's stuff) - it was still stuck in that state. Any ideas what I did wrong?
View 16 Replies
View Related
Apr 28, 2009
I have been developing a game on Android and wrote a wrapper for J2ME classes,
When notifyDestroyed() is called in my ME program and calling finish() but the application doesn't close correctly.
The App goes to background and when launched again it shows an error message and presents an option to "force close" the App, if i force close it and launch again, the app launches fine but again the same has to be repeated upon every launch..
Can you please explain why the App is not being erased from memory when finish() is called.
when i check the log i found no exceptions when closing but when launched again it throws a null pointer exception.
for now to work around I placed "System.exit(0)" after calling finish () so that the app is exited abruptly, but am waiting for a valid answer on whats going on behind...?
View 9 Replies
View Related
Sep 8, 2010
I've been using code like: activity.finish(); activity.startActivity(new Intent(activity, activity.getClass()));
in two places: onResume(), and in an onClick() method of an AlertDialog. I'm getting the desired results when the code is called from onClick(), but I get mysterious null pointer exceptions while the runtime is trying to execute my onPause(). Is calling finish() from within one of the Activity lifecycle callbacks always a bad idea?
This code makes me nervous even though it works in the onClick(). After I call activity.finish(), I would think activity is in a questionable state by the time activity.startActivity() is invoked. Seems like an invitation to race conditions.
My use case is setting UI preferences (e.g. a different layout) in a PreferenceActivity. When I return to the main activity's onResume(), I check for preference changes and if a new layout is requested, I use the code snippet above.
View 10 Replies
View Related
Feb 11, 2010
I use Google Voice (love it) primarily because of it's visual voicemail on my Droid. I do have a Google Voice number, and I'm trying to decide whether to set the Droid app to "make calls using Google Voice" or not.
I have no problem with giving out a different number, and my placed calls seeing the GV number in caller ID.
My question is, does this affect how the call is actually connected, from a quality standpoint? I tired a call both ways, and the sound quality seemed a little bit different. But then, I am an obsessive compulsive weirdo.
Is there any difference in call quality or routing between making a native Verizon call and a Google Voice call on Droid? (Like, does Google voice actual use 3G to connect to Google server over the internetz, then place the phone call?)
View 3 Replies
View Related
Nov 5, 2009
In main Activity, I called start Activity For Result(intentB, 100) to start a new activity B, then in B, I called startActivity(intentC) to start another activity C. Lastly I wanted to call finish Activity(100) in C to close activity B, but seemed it was not successfully destroyed(I can use BACK key to see it's still there.)
View 6 Replies
View Related
Mar 25, 2010
I saw another thread related to this question, but did not find the answer that was useful to me. Is it possible when the user presses the Home button to be able to finish() my activity somewhere? I saw that people were having problems with using onStop(). Has anyone found a resolution to see if this is always called on Home being pressed?
View 5 Replies
View Related
Dec 2, 2009
I would like to know whenever the top task is changing. i.e. when a new task is starting or a task is finishing or when the current active task changes. Is there an intent that is sent that I can listen to?
View 2 Replies
View Related
Sep 14, 2010
I have a parent activity (as ACTIVITY GROUP) and some child activity of this parent activity (as ACTIVITY).
I am just calling child1 now i want to move from child1 to child2 and just want to finish() child1.
But when i am calling finish() it is also finishing the parent activity.
View 1 Replies
View Related
May 10, 2010
I've heard that pressing the back button will essentially cause the current Activity to finish(). Is this always the case? Seems like it would be with the way it pops the Activity off the stack.
The one situation I'm not so sure about is when the root Activity in a Task has back pressed. I'm currently experiencing a very weird effect, described as follows:
On loading my application, the first Activity is for initialization, and once it finishes, it calls my main Activity (a TabActivity). This first init activity has android:noHistory="true" set in the Manifest so pressing Back from my main Activity won't go back to that. It goes to the Launcher. When I click on my App in the Launcher a second time, the initialization activity loads again, and loads the main Activity when done. Almost immediately after, it loads a second instance of my main Activity. But ONLY after the Application has already been run once, and was exited by pressing BACK from the main Activity. It does it every subsequent time until I force quit the app or load a new version from the IDE.
Based on this, I am suspecting some kind of Activity instance is lying around and being reused, since it only happens on the second+ time I run the application (and exit with BACK -- using HOME just returns to the last state of the app, no big deal).
View 4 Replies
View Related
Nov 4, 2010
I'm using "AppBrain App Market". I have installed a bunch of apps, but some get stuck and just stay in "Downloading" state. They just never finish downloading. I see the progress bar "barbershop pole" style but there is no sign of progress. Some are new installations, some are updates.
This is despite the fact that some apps HAVE successfully downloaded and installed. What could the problem be? How do I resolve this?
Cancelling the download and restarting the download resolved the problem once. (Downloads / click on neverending download item, Cancel Download)
But if the button series is (Downloads / click on neverending download item, *Installing*). Then the Installing button is greyed out then I'm stuck.
This thread did not provide any solutions: Market Apps Finish Downloading but Won't Install
View 6 Replies
View Related