Android :: Hide Activity On BACK Key Without OnDestroy?

Oct 28, 2009

When user presses BACK key, my activity's onDestroy is called and then it is killed. Is there a way (by overridding Activity.onKeyDown??) to simply put the activity into background without killing it? I want the BACK key to act like the HOME key (which doesn't kill my app), except I want to show the activity immediately below my activity.

Android :: hide activity on BACK key without onDestroy?


Android :: OnStop OnDestroy Called From Back Key Or Not ?

Sep 17, 2009

Each time I switch the orientation of the device, onStop() and onDestroy() are called. They are also called when I close the Avtivity (dismiss()), and when I press 'back' key. In onStop() or onDestroy() methods : how can I know how I can here ? I'd like to run some code when I close the Activity (back button), but not if I change screen orientation

View 7 Replies View Related

Android : Listener - Back Button - And OnDestroy

Mar 13, 2010

I have an application with a single Activity implemented as a singleton (in the AndroidManifest). It implements a Listener I wrote. When the application is first run the Listener works fine. When I use the "home" button to minimize it, then open it again it's still fine.

But when I press the back button then run it again from the application icon, the Listener doesn't work fully. The code runs and the Listening methods are called as usual but none of the UI elements that are listening update. It requires a restart of the phone to get the listener working again after this point.

I know the "back" button doesn't really close the application, per se. But resetting the phone sure does! Is there a way to use the onDestroy() or similar method to call a function that actually closes the application? I'm asking because restarting the phone is the only way to get the listener back so I was hoping I could do that programmatic ally.

For example, my progress bar is a member variable of my Activity, but onCreate() I do "progressBar = (ProgressBar) findViewById(R.id.progress_bar);" Is this perhaps creating a separate instance of it or something?

View 8 Replies View Related

Android :: How To Save Value OnDestroy Or OnStop / Program Launches Back Again?

May 6, 2010

I wonder if I could save a value (in my program its an index) so I could call it back when the program launches back again (even if the program destroyed) and the user could start from where finish.

View 2 Replies View Related

Android :: Activity Being Killed - OnDestroy - On Orientation Change

Apr 5, 2010

I am working on a MVC implementation for Android (to be subsequently hosted on SF and/or GC).

It works like this:

Activity (View) <=> Application (Controller) <=> Data (Model) <=> Persistence (DB/Network etc)

The scenario is:

1. Activity launch (main/launcher)

2. Notifies Application about performing a data transaction

3. Upon receipt of data response, controller devices which Activity to launch (or update existing)

4. Application has overridden the method onConfigurationChange

Problem: When the orientation is changed, the Application is notified about onConfigurationChange but:

a) The "current" activity is Destroyed and recreated -- which is fine to some extent b) The new instance which is created is automatically => onCreate, onPause, onStop, onDestroy.... now that's catastrophic.

View 4 Replies View Related

Android :: Activity Execute OnDestroy() / OnCreate() Method When Push On Keyboard

May 2, 2009

I use sdk 1.5 version and same to my handphone, my handphone is use G1. Now i test my application on my handphone. When i push on keyboard, i found system will destroy current activity(execute onDestroy() method) and execute onCreate() method again. So i will all current status and all datas. I don't wish this happen, how to block system execute onDestroy() and onCreate() when i open and close keyboard?

View 2 Replies View Related

Android :: Unbind Remote Service In OnDestroy Of Activity On Screen Orientation Change

Nov 24, 2010

In onCreate method of Activity, it binds to a remote service and makes use of AIDL intefaces. Is it required to unbind from the remote service when onDestroy is called on screen orientation change.?

If the activity un-bounded from the remote service in onDestroy and if no other contexts are bound to remote service, is remote service likely to get stopped losing the state that it maintains.?

View 1 Replies View Related

Android :: Hide And Activity When Activity On Top Redirecting To Home Screen

Mar 3, 2010

example scenario is: from login screen - main screen - then when i clicked a hide button inside the mainscreen, the app will need to go in the home screen, and when im going to click the app again the main screen would be called and not the login screen

View 3 Replies View Related

Android :: Hide Activity GUI In 2.2

Sep 28, 2010

I want to click a button and then hide the activity GUI. That is, GUI is needed and you can hide it by clicking a "Hide App" button. How can i implement this "Hide App"?

View 3 Replies View Related

Android :: Hide Title Bar For Activity In XML

Apr 7, 2010

I want to hide the title bar for some of my activities. The problem is that I applied a style to all my activities, therefore I can't simply set the theme to @android:style/Theme.NoTitleBar. Using the NoTitleBar theme as a parent for my style would remove the title bar for to much activities. Can I set a no title style item somewhere?

View 4 Replies View Related

Android : How To Hide Soft Input Like Using BACK Buton?

Jul 11, 2009

In my app I have AutoCompleteTextView and "search" button. When user clicks "enter" or "search" an Intent is fired and new Activity is started. But in that "new" Activity SoftInput should be invisible, so I make ((InputMethodManager)getSystemService (INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(this.getCurrentFocus ().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); But when user clicks BACK and returns to activity with form he is unable to show soft input back by touching AutoCompleteTextView. He mus use trackball to select "search" button and than touch ACTextView. Bud when he is in "form" activity first time, shows soft input by touching AutoCompleteTextView and presses BACK button he is able to show soft Input by touching field. How can I hide soft input "correctly" (so it can be shwed back in intuitive way?) or hide it like BACK button does?

View 4 Replies View Related

Android :: Start An Activity And Return Back To Original Activity

Jan 26, 2009

I have an application with contains multiple activities. The main activity will start the others ( use startActivity() ) depends on user event, when an activity close, it calls finish() and return back to main activity. It appears to behavior like that.

However, the "problem" I see is main activity's onCreate function is called every time. I think the the main activity should be placed in the activity stack and simply push to front when others exit, therefore only onResume, onStart are called. Is there some flag I need to set or I misunderstand the activity behaviro?

In child activity, besides calling finish() or startActivity for main activity, what is other way to move main activity to front?

View 2 Replies View Related

Android :: How To Clear Activity From Second Activity Going Back To Home Screen?

Mar 3, 2010

example scenario is: from login screen - main screen - then when i clicked a hide button the app will go to home screen, and when im going to click the app again the main screen would be called.

View 2 Replies View Related

Android :: Hide Soft Keyboard On Activity Without Any Keyboard Operations

Oct 13, 2010

I have a tabbed view with one Activity per tab, and when I switch from the first tab, which has a TextView, to the second tab, which only shows a clickable list, the soft keyboard is still there. I want it to go away.

I tried this:

CODE:.............

But this does not work, because there is no relevant view to provide, as there is no View on the screen that takes keyboard input.

View 1 Replies View Related

Android :: Back To Activity When Call Is Done

Nov 24, 2010

I am launching an activity to make a phone call, but when I pressed the 'End Call' button, it does not go back to my activity. Can you please tell me how can I launch a call activity which comes back to me when 'End Call' button is pressed?

View 5 Replies View Related

Android :: Back Button Activity

Aug 25, 2010

I was wondering how or if it is possible to exclude activities from the back buttons history list? For example not letting the user back into the Splash Screen?

View 2 Replies View Related

Android :: Back To Activity After WebView?

Nov 14, 2009

I've been searching and looking for this answer for quite some time now. I want to display a little HTML in a webView.

When the User read the HTML, he's supposed to use the back button to go back to the previous activity. However, it closes the App.

How can I make it go back to the last Activity? It would also be ok to display a soft back button or something. Here my code...

View 2 Replies View Related

Android : Activity And Back Button

Nov 2, 2010

on the ui i am having a back button displayed. there are three activities say A,B,C. Activity A is splash screen. Activity B is home screen. Activity C is edit screen. on edit screen only i am having a back button. when the user press that i open the activity B which also contains some sort of http request and response. i want that the previous activity from stack should get displayed? how can i achieve that? i am able to open previous activity on pressing the back button of device? when i press back button on device there doesnt goes any http request? i want to achieve this behaviour when i press the ui back button.

View 2 Replies View Related

Android : Back Button And Last Activity

Aug 17, 2010

My app chains some activities.

if you press the back button, you go back through old activities then you suddenly quit the application !

so I need to show a message like "do you really want to exit" if it's the last activity on stack

I know how to override the back button but i can't figure how to know how many activity are in history

CODE:..................

View 1 Replies View Related

Android : Back Key Destroy An Activity

Jul 14, 2010

I have an activity defined as below:

CODE:............

A strange thing is that, when running on emulator, and the back key is pressed, the activity was destroyed (I saw onDestroy() called in log). But when running on my Nexus One phone, and the back key is pressed, the activity is not destroyed (I didn't see onDestroy() called in log).

View 1 Replies View Related

Android : Need To Get Result Back From Activity?

Mar 10, 2010

I'm doing some network job in AsyncTask. Sometimes it requires communication with user. (connection is dropped, session is expired and so on). I want to pop up a dialog or launch an Activity, and then, depending on user's input, stop the job or redo it. I can launch any Activity from AsyncTask, but how to get result back? It seems to be possible only if I launch new Activity from another Activity. What are possible solutions?

View 5 Replies View Related

Android :: Releasing Resources In OnDestroy

Aug 20, 2010

I understand that the system may kill the activity without calling onDestroy(). Say I have a MediaPlayer that runs even when it's not visible, I would be releasing the player in onDestroy() method.Now, if the system decides to kill the activity after calling onPause() and never called onDestroy(), what does it mean for my MediaPlayer? Is it ever released? This is bigger problem for Camera since I think it requires to be released for other activities to use it.

View 1 Replies View Related

Android :: Service.onDestroy() Invalid?

Sep 30, 2009

I use AlarmManager to restart my service, code is:

CODE:........................

After 5 seconds, BootCompleteReceiver will startServcie(), but only see onStart() not onCreate() calls.

Is the way of destroying the service wrong? BootCompleteReceiver is written in AndroidManifest.xml

View 2 Replies View Related

Android :: Testing Low Memory And OnDestroy

Jun 21, 2010

Testing onDestroy.

Q: does using a lot of RAM in one application always lead to onDestroy being called on Activities in other applications?

To try and figure this out I created two separately installed applications. The first just logs its lifecycle transitions and the second allocates a chunk of memory each time you press a button.

What I saw was the second application eventually suffered a fatal Out Of Memory Error force close. The onDestroy method was not called on the first logging application and when I switched back to it onResume was called.

My conclusion is that using a lot of memory in a single application will lead to a fatal Out Of Memory Error without onDestroy first being called on Activities in other applications. The documentation left me expecting an onDestroy on the logging application since the foreground application was trying to allocate more memory.

Does the above sound right? What's a good way to test the onCreate/ onDestroy lifecycle methods as they relate to low memory?

View 2 Replies View Related

Android :: OnRestart() Being Called After OnDestroy()

Jul 21, 2009

Every once in a while my activity gets restarted after it's destroyed instead of being created again. I.e. I see:

CODE:..........

instead of:

CODE:............

Looking back in my log I can see this happening periodically, but no apparent pattern to it. This certainly isn't in the state diagram, and needless to say this doesn't make for a happy app.

View 4 Replies View Related

Android :: Any Way To Go 2 Steps Back In Activity Stack?

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

Android :: Start Browser Then Go Back To My Activity

Jan 29, 2009

Our application has a fair amount of java script. As far as we known, WebView widget doesn't handle AJAX, therefore we want to bring up the brower to load the url. The problem is, after user done with browser, how can it goes back to where it left in our application? ( when user quit the browser, our application will show up the activity before went to browser)

View 2 Replies View Related

Android :: How To Come Back Main Activity From Child One?

Mar 30, 2010

I'm in a small problem.i have three activities (suppose A,B,C) after performing onclick event in activity A, i can go to activity B and then C..my question is that is there any way to comeback activity A from C..here is the code snippet public void on Create(Bundle Code...

View 3 Replies View Related

Android :: Star Activity And Back Button

Oct 22, 2009

I am starting an external activity from my application and would like the back button to return the user to the point in my application where they started the activity. is this possible?

View 7 Replies View Related

Android :: How To Manipulate Activity Back Stack?

Nov 22, 2010

I want to implement the following logic. I have 4 activites A, B, C and D. The flow is A -> B -> C -> D When the user navigates from A -> C he should be able to get back to the previous activities by pressing the back button. But after reaching D pressing the back button should take him to activity A. And pressing the back button againg should exit the application instead of taking him back to B / C / D. How do I do it.

View 1 Replies View Related







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