Android :: Translucent Activity Not Calling OnStop On Exit
Dec 3, 2009
I'm having this strange issue where upon exiting a subactivity that is translucent (android:theme="@android: style/Theme.Translucent" ) the onStop() method doesn't appear to be called. have a TimerTask that runs and is supposed to be terminated when the subactivity ends in the onStop() method, but I'm instead left with an orphaned thread running in the background. It go particularly bad when I ran the subactivity several times. When I revert to no theme, the onStop() method is called and the activity behaves properly. Is there something I missed about how Translucent activities'lifecycles differ from standard activities?
View 4 Replies
Apr 28, 2010
I have an application that is silencing the ringer while it is open, then when it closes it unsilences it. Currently I am doing these two things in OnStart and OnStop. The only problem (and it's a big one) is that when a phone call comes in, it stops my application (calling OnStop), then rings at its normal volume. Is there any way to get around this? I tried using onCreate and onDestroy, but I want to restore the original volume setting as soon as the program is closed, which onDestroy doesn't seem to do. You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscribe@ googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
View 8 Replies
View Related
Oct 14, 2010
i`ve got some problems with finish() method. I expect what after calling on my Activity finish() method onStop and onDestroy must be triggered(or am wrong??), in majority of examples they are, but Scenario: - reboot phone - launch activity - invoke finish() onPause is triggered but afterwards they are no calls to onStop() and onDestroy()I`ve noticed, that those calls are triggered after launching any other activity.
View 7 Replies
View Related
Dec 3, 2009
I need be able to tell if Activity.onStop() was called because my application is moving to a new activity, or if it was closed because the user pressed the "Home" key or hit the back button from the bottom of the activity stack.The reason is because I need to know when it is appropriate to shut off music that is playing in my application (A game). There is nothing more annoying than hitting home and having something playing music in the background.However, Activity.OnStop() is called for each activity change, and I don't want to suspend music when moving between multiple activities in my app. I just can't find a way to differentiate between going home and going to a internal activity.Am I perhaps hooking into the wrong events?
View 3 Replies
View Related
Nov 1, 2010
Is there a way to open a translucent or transparent activity so that you can still see the old activity behind it on the screen?
View 1 Replies
View Related
Oct 5, 2010
In the Android Application Fundamentals it says that after the call to the onStart()-method of the activity lifecycle either the callback method Resume() or onStop() is called. In case of an "normal" Start of an activity the system calls onCreate(), onStart(), onResume().But does somebody know an example where onStart() - onStop() are executed one after another?
View 2 Replies
View Related
Sep 30, 2010
I got a graphical problem regarding the Translucent theme at Samsung Galaxy i9000.It works well in the emulator with android version ranging from 1.6 to 2.2 as well as on SE x10 mini.I have yet to test on more devices.I am starting an activity from a broadcast receiver. The activity started got the theme @android:style/Theme.Translucent If all the activities in my application are destroyed when the broadcast occurs, then the new activity got a working translucent theme and is presented on top of the activity currently in front. However, if the user left the application with the HOME-key, not destroying the activity, I get a graphical bug when the broadcast triggers. The application gets brought to the front with the activity the user last visited showing instead of the new activity that I started from my broadcast receiver. When I press the back key I can see my Translucent activity quickly showing itself and then getting destroyed.This flow results in the graphical bug: Start application. Activity A will be shown. Leave application by pressing HOME-key. Home screen is shown. Trigger broadcast. Start activity B.
Application gets brought to foreground and activity A is shown. Press BACK-key. Activity B quickly shows itself and disappears. Now activity A is shown.Also, after activity B is started and when activity A is shown in its place. Pressing the screen will triggers buttons that belong in activity B even if the user can't see them. If I remove the theme, then activity B will show itself when it's supposed to.Is there anyone else who have encountered a similar problem? Is there any good workarounds I can apply? (I don't want to rebind home to finish all activities) Is the problem my fault or can there possibly be some glitch in Touchwiz?
View 2 Replies
View Related
Aug 31, 2010
Just like the title says, Is there a simple line of code I could add to onStop()that will simply stop any gps activity currently going on with my application?
View 1 Replies
View Related
Mar 4, 2010
I have a problem with the activity lifecycle specifically on Nexus One (2.1 running on emulator works fine). If I just create a simple empty Activity with no special launchModes that logs the calls on the onStart and onStop methods, this is what I see: - launch app: onStart called; - home button: onStop NOT called; - launch app: onStart NOT called; - home button: onStop NOT called: and so on. Sometimes if I press the back button then the onStop is not called, but the when i launch the activity again the onStart is called and right after the onStop is called. Similar results with different launchModes. What is going on? Can anyone confirm this?
i found an android issue for the problem here: http://code.google.com/p/android/issues/detail?id=6094 and a similar thread here http://groups.google.com/group/android-developers/browse_thread/threa.
View 24 Replies
View Related
May 18, 2010
When exiting the activity in a thread in a SurfaceView. This log appears in this situation:.............
View 2 Replies
View Related
Feb 6, 2009
How to set RESULT_OK when activity exit? I am launching list activity from main activity using startActivityForResult, after doing work with list activity; i exit from it from it using "finish()" but it doesn't propagate RESULT_OK to main activity in onActivityResult(), what should I do , so that listact should return RESULT_OK.
View 2 Replies
View Related
Jul 9, 2010
I have a Contact Activity which is derived from ListActivity, which displays list of contacts, and on click of item, a new Activity Message Activity derived from ListActivity is initialized.Now I know, I can pack some information in Bundle and pass it before creating activity, but is there a way I can get instance of "ContactActivity" in onCreate method of "MessageActivity"?
View 1 Replies
View Related
Jan 11, 2010
How to animate activity entrance and exit? And activity relaunch after onNewIntent()?I used android:theme in the manifest file but it didn't work for me.
View 2 Replies
View Related
Dec 2, 2009
what puzzle me so much is that i can't destroy a GLSurfaceView while i don't want to exit the activity.
the fact is when i destroy a GLSurfaceView which had show in the screen (that means it has binded to the activity's SurfaceHolder), the activity exits without any prompting. Perhaps ,the Context which provided in the Construction of GLSurfaceView joins the two things together. so my conclusion is that a GLSurfaceView can only be destroyed when exit the activity. is there anyway to destroy a GLSurfaceView without exit activity? is there someone can provide a clue?
View 2 Replies
View Related
Jan 21, 2010
I've been using System.exit to quit the application. Is Activity.finish a better approach? What would be the differences?
View 6 Replies
View Related
Jul 22, 2009
I have requirement that needs to save data to a file. During multiple Activitiy screens, I add different data to a list and finally when user is not using the app (means if user exits app by pressing "home" button or "call" button), just before exiting that app, i want to save that data of the list to a file.
coding before exiting activity screen is simple - by calling onDestory () method, but here I want not one activity but the application exit.
So my question is How do I write a code that will be executed just before application exits ? I tried created one class extends Application, and then I override onTerminate() method, but it's not get called when I exit ( pressing home button on device)
View 2 Replies
View Related
May 3, 2010
What I am trying to do is emulating the "Home" button which takes one back to Android's homescreen. So here is what causes me problems: I have 3 launcher activities. The first one (which is connected to the homescreen icon) is just a (password protected) configuration activity. It will not be used by the user (just admin) One of the other 2 (both accessed via an app widget) is a questionnaire app. I'm allowing to jump back between questions via the Back button or a GUI back button as well. When the questionnaire is finished I sum up the answers given and provide a "Finish" button which should take the user back to the home screen.
For the questionnaire app I use a single activity (called ItemActivity) which calls itself (is that recursion as well when using intents?) to jump from one question to another:
Questionnaire.serializeToXML();
Intent i = new Intent().setClass(c, ItemActivity.class);
if(Questionnaire.instance.getCurrentItemNo() == Questionnaire.instance.getAmountOfItems()) {
Questionnaire.instance.setCompleted(true);
} else Questionnaire.instance.nextItem();
startActivity(i);
The final screen shows something like "Thank you for participating" as well as the formerly described button which should take one back to the homescreen. But I don't really get how to exit the Activity properly. I've e.g. used this.finish(); but this strangely brings up the "Thank you" screen again. So how can I just exit by jumping back to the homescreen?
View 2 Replies
View Related
Jun 23, 2010
I have faced with issue about startActivityForResult() and onActivityResult(). If child activity started by the startActivityForResult() exit by unexpected exception the onActivityResult() is not called and I have no any ideas how can I handle this to get application working in a fail-safe manner ?
When my code runs child activity with startActivityForResult() it awaits until onActivityResult() will be invoked to get working further, but onActivityResult() is not calling and my code is "hang- up" (logically).
So the question is how can I handle all possible ways the child activity is finished (normally and by unexpected exception) to get fail-safe code ?
I have check the documentation for this issue but have found nothing relating issue.
View 4 Replies
View Related
Feb 13, 2010
I've been trying to show a "Do you want to exit?", type dialog when user attempts to exit an activity. However can't find the appropriate API hooks. Activity.onUserLeaveHint() initially looked promising, but I can't find a way to stop the activity finishing.
View 2 Replies
View Related
Dec 7, 2009
I have a TabActivity subclass that attempts to start a new activity via a menu item selection in onOptionsItemSelected.I am receiving the following exception which eludes me at the moment.I'm not sure why it thinks I am *not* in an activity!
View 2 Replies
View Related
Nov 19, 2010
i am writing an app in which i need a background service to call an activity and show some result.
View 4 Replies
View Related
Apr 4, 2010
me and my partners are working on developing a pwa client for android Am getting an error while calling an activity from another activity.the error is as follows...
View 3 Replies
View Related
Oct 28, 2010
I am developing an app where a single activity is instantiated multiple times by itself. I guess you could think of it like a book where each activity is a page. At the end of the page (activity) the user presses a button to go to a new page. I fire off an Intent for the same Activity, but I push different data into the Bundle so that a different page is loaded. This works fine, and I like the fact that the user can back up to a previous point, but my question is whether this will eventually be a problem? What happens if this activity is instantiated 10 times, or 50, or 100? Will the device run out of memory, will GC come along and clean up old activities, or what? If GC does clean them up, what happens when the user presses Back and the previous Activity is no longer on the stack? Is it better to keep track of the user's path, finish() the activity, and override the Back button so that whether the user is moving forward or backwards, I only load a single Activity? Another approach I could take is to refresh all the data on the page so that it's still the same activity, but with new data. The Back button would not work as expected in this case.
View 2 Replies
View Related
Apr 23, 2010
I'm writing an android application which listens the phone calling events. What I want to do is, if there is a call incomes or outgoes, an activity shows with my customized info.I want to this screen keeps showing during the calling period. However, if a call is coming, the system UI which shows the contact always appears on top of my activity.I've found some apps already realized this function, but mine can't.
View 1 Replies
View Related
Sep 11, 2010
I'm using an AlarmManager to trigger an intent that broadcasts a signal. The following is my code:
CODE:................
I'm calling this code from an activity, so I don't know how I could be getting the following error...
CODE:....................
Is this really what you want?
View 1 Replies
View Related
Oct 12, 2010
I have implemented a ListView in my Android application.
I bind to this ListView using a custom subclass of the ArrayAdapter class. Inside the overridden ArrayAdapter.getView(...) method, I assign an OnClickListener. In the onClick(View v) method of the OnClickListener, I want to launch a new activity.
I get the exception:
Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
How can I get the context that the ListView (the current Activity) is working under?
View 2 Replies
View Related
Apr 26, 2010
The first Activity that loads in my application is an initialization activity, and once complete it loads a new Activity. I want to ensure if the user presses 'Back' they go straight to the Launcher, and not the initialization screen. Side note, is this even the best approach, or would this be better done with some kind of Intent Flag?
Is it correct to call finish() after calling startActivity() on the new activity?
CODE:...................
I'm still taking in the whole 'Message Queue' method of doing things in Android, and my assumption is that calling startActivity() and then finish() from my first Activity's onCreate() will log each respective message in the message queue, but finish execution of onCreate() before moving on to starting the next Activity and finishing my first one. Is this a correct understanding?
View 1 Replies
View Related
Feb 2, 2010
Can any one guide me how to achieve this?
View 4 Replies
View Related
Jul 23, 2010
I have two activities:
"a" that spawns thread for generating a dynamic array of values inside public void run() function.
"b", graphics activity that will help me draw rectangular pulses based on array values calculated in activity "a" (calculated in a's thread to be precise).
When I am in thread inside "a", how do I pass values of array to activity "b" and
call activity as well.
activity A
CODE:..........
activity B
CODE:..............
View 1 Replies
View Related
Jul 1, 2010
I have an image which is taken from andorid by calling image _capture how do i upload it to a windows server?
View 1 Replies
View Related