Android :: OnStop Does Not Affect MediaPlayer
Oct 12, 2010
I have a mediaplayer object inside an activity that plays from mp3 files situated in the res/raw folder. The MediaPlayer.create(Context context, int resid) method is used to create and return a mediaPlayer object to play this track. What I have noticed is that when the activity is obscured by another activity and hence the "onStop()" method is called , the music continues to play. Can anyone explain why this occurs? I though that onStop would essentially freeze any actions taking place by objects associated with the activity, except for services etc
View 1 Replies
Apr 27, 2009
I have a requirement to play several sounds many times in my game so instead of creating the MediaPlayer again and again I have called mp.seekTo(0) in onCompletion(mp) so that it will restart. Sometimes the sound is not audible from the device when I call mp.start () after setting mp.seekTo(0); but the player calls onCompletion() without playing any sound, this is observed randomly on most of the sounds
My sounds are of short duration mostly less than a second.
I am using a separate MediaPlayer for each sound (as I need this) -
There are almost 28 sounds in my game so i will be creating 28 MediaPlayers.
Below is the attached code for player
Also If I try to play many sounds one after the other in a short period of time i get an error saying "no more track names available". can u tell Why this is happening...?
check the below code:
CODE:........
View 9 Replies
View Related
Oct 7, 2010
I am seeing an issue where when I hit the "back" button, I get the onPause call, but it isn't followed by onStop and on Destroy. On most phones, I see this, but on one particular phone (Droid-X),
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
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
Oct 16, 2010
I have two activities. One loads all rows from a database, and the other saves to the database. When I have the second save in onStop and the first repull the data in onResume, they do it out of order (the first resumes and then the second saves). I managed to fix this by putting the saving data in onPause, but why was this happening? Was this the cleanest way to do it?
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
Jul 14, 2009
I'm saving the state of my activities for orientation change support, it works well. Sometimes I have a dialog open though and need to save its state as well. My dialog's onStop() method doesn't seem to get called when I change orientation. Where would get notified inside the Dialog that we're being destroyed, so I can save its state?
View 3 Replies
View Related
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
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
View Related
Jul 24, 2010
The docs say "The onStart() and onStop() methods can be called multiple times, as the activity alternates between being visible and hidden to the user"When I press the back button an it will go back to the previous activity which totally covers the old one.What is going on here?
View 1 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
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
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
Sep 28, 2012
There are some process manage application that allows user stop any running aplication by a button pressing. I want to know, in these situations, the onStop and onDestroy methods will always get executed?
View 6 Replies
View Related
Feb 16, 2010
I like the idea of the Alliance, it is very logical. It raises a question for me though. How do they intend to run apps seamlessly across multiple operating systems? Will the apps all have to be developed in something like Java? I am studying mobile app development, targeting the Android OS, and using Java. I was about to order a load of books(eg hello android) on developing apps for Android today, but I worry the new Alliance platform/technology might render these books and my initial studies obsolete in some way.
View 3 Replies
View Related
Feb 10, 2009
I would like to write m2 (m to the power of 2, 2 should be on top of m in lower case).
View 6 Replies
View Related
Mar 14, 2010
Do you think this is ATT's doing, Motorola's, or maybe Apple? How do you think it will affect other Android devices on other carriers?
View 6 Replies
View Related
Sep 26, 2010
Do they reduce the signal strength? Does the phone have to work harder to compensate?
View 2 Replies
View Related
Jan 13, 2010
I downloaded wall switch, its an app that will automatically switch your wallpaper for you. I had something like this on my pre and loved it. Basically you pick the folder you want it to pick the pictures from,and how often you want it to switch.
Now to the interesting side affect.. One of the settings is Processing method, your choices are auto,crop,or letterbox. If you leave it on auto it places your regular pictures as they should be viewed on your background. It does not force you to crop your picture and end up with a fuzzy picture!
I was super excited when i found this,for years ive had a folder with just pictures i liked to use as backgrounds on my phone. So obviously those pictures wouldnt show the way i would like them to on an android device.
So i figure if you dont want to switch your background but would like it to appear as it should without having to crop it, you could create a folder with 2 of the same picture in it and set it to switch between those...
You might even be able to mess around with the settings and get it to work with just one... im thinking that you may be able to set the switch interval to 0:00 or something like that, but im not sure on that..
View 5 Replies
View Related
Aug 7, 2010
Ive been trying to implement a limit to prevent the user from scaling the image too much in my multitouch zoom app. Problem is, when i set the max zoom level by dumping the matrix, the image starts to translate downward once the overall scale of the image hits my limit. I believe it is doing this because the matrix is still being affected by postScale(theScaleFactorX,theScaleFactorY,myMidpointX,myMidpointY) where theScaleFactorX/Y is the amount to multiply the overall scale of the image (so if the theScaleFatorX/Y is recorded as 1.12, and the image is at .60 of its origional size, the overall zoom is now .67). It seems like some sort of math is going on thats creating this translation, and was wondering if anyone knew what it was so i can prevent it from translating, and only allow the user to zoom back out.
View 1 Replies
View Related
Nov 28, 2010
I originally setup my Droid with my Google Apps account as primary. A few months ago I decided to buy a paid app in the Market and couldn't do so using my Google Apps account. Reluctantly, I added my Google Account as a secondary account on my phone, which allowed me to purchase apps in the Market. Now that I can finally use Google Checkout with my Google Apps account, I would like to remove my Google Account from my phone, since I'm tired of being prompted to select an account each time I create a new contact. Will removing my secondary account affect apps that are already installed? What about when updates become available for these apps in the Market?
View 6 Replies
View Related
Jun 4, 2010
I love the Incredible, but I'm afraid that the Evo is taking all of our developers. Do you think that we are going to turn into the Sprint Hero with no ROMs, etc.
View 18 Replies
View Related
Jun 3, 2010
Just as it reads, with the update HTC is sending shortly after the phone is officially launched, might it make it harder to root, or change the method?
View 2 Replies
View Related
May 15, 2010
EXCLUSIVE: More Information And Pictures Of Android 2.2 Froyo's Tether And Built-in WiFi Access Point/Mobile Hotspot Capabilities | Android News, Reviews, Applications, Games, Phones, Devices, Tips, Hacks, Videos, Podcasts - Android Police.
View 17 Replies
View Related
Jun 9, 2010
If this is a ridiculous question, I apologize in advance. I currently have my Evo rooted with toast method, and am using the 8GB SD card that came with it. I am going to buy the 32GB card in the next few days and just was wondering if swapping out those cards would undo any of the things I have done root/rom-wise so far or if I have to take anything into consideration whatsoever?
View 1 Replies
View Related
Jul 8, 2010
I noticed a few days ago Friday that my battery all of a sudden started draining faster; a lot faster. I did a FDR Tuesday night and through most of the day Thursday it was much better. Thursday evening i started reinstalling apps to test if it was actually better and noticed as soon as i did that the phone was never sleeping again. My up time and awake time were almost the same as soon as i reinstalled everything. So last night I uninstalled everything again except for swype. I'm going to watch it today but I'm not sure what to expect. Have you seen swype affect your battery life.
View 11 Replies
View Related
Jun 2, 2010
I gave a leather holster to my cousin, since it looks like it won't fit the EVO and fits the iPhone perfectly... After 2 days, his screen has this line across the screen. Was this caused by the case I gave him, more specifically the magnets on the case? Will magnets from the leather case damage TFT-LCD screens?
View 3 Replies
View Related
Jul 22, 2010
Just curious of what you guys have your resolution set on, 720 or 480 and does battery affect this?
View 3 Replies
View Related