Android :: Getting Crash When Exiting Activity?

Sep 4, 2009

I am experiencing a crash in my app when I quit (via the back button) out of my Activity. So far as I can tell this is happening in the Android codebase and not mine, but I'm not completely convinced of that.

AndroidRuntime E Uncaught handler: thread main exiting due to uncaught exception
AndroidRuntime E java.lang.RuntimeException: Unable to stop activity {MyApp/MyApp.MainActivity}: java.lang.NullPointerException
AndroidRuntime E at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3097)
AndroidRuntime E at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3159)
AndroidRuntime E at android.app.ActivityThread.access$2400(ActivityThread.java:112)
AndroidRuntime E at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1724)
AndroidRuntime E at android.os.Handler.dispatchMessage(Handler.java:99)
AndroidRuntime E at android.os.Looper.loop(Looper.java:123)
AndroidRuntime E at android.app.ActivityThread.main(ActivityThread.java:3948)
AndroidRuntime E at java.lang.reflect.Method.invokeNative(Native Method)
AndroidRuntime E at java.lang.reflect.Method.invoke(Method.java:521)
AndroidRuntime E at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)
AndroidRuntime E at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
AndroidRuntime E at dalvik.system.NativeStart.main(Native Method)
AndroidRuntime E Caused by: java.lang.NullPointerException
AndroidRuntime E at android.app.Activity.performStop(Activity.java:3575)
AndroidRuntime E at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3092)
AndroidRuntime E ... 11 more

Android :: getting crash when exiting Activity?


Android :: Orientation Change Crash In Tab Activity With List Activity

Jan 21, 2010

When views with different type have same id and screen orientation changes,

either java.lang.ClassCastException: android.view.AbsSavedState$1 or java.lang.IllegalArgumentException: Wrong state class -- expecting View State will occur. (depends on the view's order)

Because View.dispatchRestoreInstanceState() checks id only.

You may wonder why anyone would make views with different type to have same id.

But it can happen when you use tab activity.

Imagine you have tab activity with two children activity.

Tab1 is ListActivity and Tab2 is ExpandableListActivity.

Both activity have id of "@android:id/list" but the type of view is different.

This means we cannot use ListActivity & ExpandableListActivit at the same in one tab activity.

View 4 Replies View Related

Android :: How To Save Activity's State When Exiting - Android?

Feb 22, 2010

I have a basic app with text inputs, a spinner input, and a second spinner input whose array depends on a setting changed in the Options menu. Currently, when I press Home or press Return while in my app, I either return to the desktop or cycle back through old inputs i put in recently. How can I prevent my app from opening multiple instances of itself so that there is only one instance running at any given time, and then how can I save the data entered into inputs, and the settings chosen in my option menu? I'm a bit new to Java, so I apologize if this is a simple problem.

View 1 Replies View Related

Android :: Activity Restart Crash After OS Kills It

Mar 8, 2010

Activity SplashScreen is the launching activity for my app. It sends a request to my server and gets back a user data it then uses to populate a user object which is a static object. Once it has that it calls the MyMapView activity and finishes itself. A force close occurs when I hit the home button and then open up enough other apps so that Android kills MyMapView to get more resources. Now when I open my app again it tries to start MyMapView and bypasses SplashScreen. There is no user object so I get null pointer exceptions. I have tried to Override the onSaveInstanceState and OnRestoreInstanceState but it seems that those are not available when Android kills the activity. I also tried android:finishOnTaskLaunch with the SplashScreen (maybe this should be put on MyMapView but the article I read said different) and that seems to have no effect. What I would like is for the activity to not restart after Android has killed it. What can I do about this?

View 5 Replies View Related

Android :: Crash When Activity Starts Up And Screen Gets Rotated?

Jun 26, 2009

I am getting a crash intermittently when my Activity starts up either initially or when the screen gets rotated I get several log messages which I have been unable to get any insight from: timeout expired mFreezeDisplay=1 mFreezeCount=0 App freeze timeout expired Force clearing freeze then lots of: Lock_layer timed out (is the CPU pegged?) Key dispatching timed out then I get ANR annotation: keyDispatchingTimedOut the trace has alot of sending signal 3 to alot of PIDs

View 2 Replies View Related

Android :: Intent Activity Crash Behaviour - App Restarts Halfway Through The App

Oct 13, 2010

I have a pretty standard iPhone app that creates a series of around 7 unique Activities initialised by Intents.

However if the app crashes on the 7th Activity, the app restarts on the users phone around the 5th activity. The problem then is the info gathered from activities 1-4 is null, meaning the app is useless and the only way to get the app working again is to either continually press back or else kill the process.

Why does this behaviour occur, and is there a way to force the app to start back at the first activity when it crashes.

View 1 Replies View Related

Android :: TabActivity Crash When Create Tabbed View In Widget Configure Activity

Dec 4, 2009

I'm trying to create a tabbed view in my widget configure activity. I'm using a tab activity as my activity type and I have the following code..................

View 2 Replies View Related

Android :: Warning Before Exiting Application?

Jul 29, 2009

I have an app that receives and stores SMS messages. The main use is to run in the background, although it does have a full GUI when running in the foreground. I'm using a notification with the FLAG_ONGOING_EVENT flag so users can tell the application is running, even if it's in the background. However, the user could easily close the app by viewing the main screen and clicking the back button. The notification icon goes away, but I would like to be able to warn the user that closing the app would prevent it from capturing the SMS messages. Is there any way to prompt the user if they really want to exit the application when they hit the back button, and prevent the exit if they say no? Or should I take a different approach? And a bonus question: is there a way of receiving an SMS message, but prevent it from passing on to, say, the Messenging app?

View 5 Replies View Related

Android :: ADB Shell Exiting Abnormally

Oct 13, 2009

I find that when I am running 2 android devices connected to 1 linux machine, I find I can get ADB shell to exit abnormally. If I start a shell on Device 1, then on Device 2 start a shell and type reboot. Device 2 resets like expected, but the shell on device 1 will exit. I find that functionality of running controlling multiple devices with ADB very useful for testing. My question is can anyone reproduce this? Has this been fixed upstream? Is ADB planning on first class support for multiple devices, or was this an after thought feature? Any help debugging this, or possible just a little information in the right direction so I can make a patch myself.

View 5 Replies View Related

Android :: Process Died After Exiting Application

Jan 14, 2010

I am seeing a curious behaviour in my app. I have a widget that gets updated by a service every # hours, when the service finishes I stop it, using "stopService(new Intent(this, MyService.class));", the widget if pressed launches an Activity. Now it gets interesting, while im on the activity everyting works fine, then when I exit the app(by the back key or a button I designed which simply calls this.finish() ) the ActivityManager would tell me that my process has died, I do not see any error of any kind, just that the process has died.

Why I am seeing that message and what does it mean exactly? That is having a side effect on my service regarding static variables getting set to default. Could my code be the cause of this? Is there any way to know that your process has died? I have tested my app on a HTC Hero running 1.5, it always works well on the emulator and I never get that message. I know android kills processes to reclaim memory but Im always careful to close apps heavy on resources.

View 4 Replies View Related

Android :: Execute Code Before Exiting Application?

Nov 18, 2009

I would like to know how to execute code before exiting application. My application is composed of several activities. When the user starts the application (from the launcher menu or from a notification in the status bar), he goes in an InitActivity where I process some initializations. From user experience, application always restarts. One of these initializations is to init a network manager and start a thread that periodically sends a network request to notify a server that application is active.

I need to process some end operations, like stopping this thread when user quits application, for example by pressing the HOME key or BACK key when he's in the root activity. However, when the user press the HOME key, application is still running in background.

Q1 : is it possible to execute code when exiting application (I see the onTerminate() method of the class Application but it seems not to be always called)?

Q2 : Is it possible to force application exit (activity method finish () only destroy the current activity, not the application)?

Q3 : Is it possible to handle HOME key press (onKeyDown() is not called when this button is pushed)?

View 3 Replies View Related

Android :: Service Won't Stop When Exiting Application

Jul 13, 2009

I have a service receiving and sending data to a server in separate threads each. The service lifecycle methods look like this:..................

View 3 Replies View Related

Android :: Exiting From Xml.parse When Match Found

Aug 18, 2010

I'm using the Android SAX parser to search for entries in a rather large (6MB) XML file. I'm basically using a derivative of the code shown in listing 8 here. The question I have is how do I stop parsing once my match has been found? The code shown continues parsing through the end of the file but I want to stop before then. Is this possible or do I need to use something other than SAX

View 1 Replies View Related

Android :: Stay Running In Background Exiting Applications

Jun 20, 2010

I've been researching the OS a bit and I can't really tell what happens to programs when you hit the home button to leave them. Do they stay running in the background? After a little bit of time does the system close them out? What happens to them? I have a Sprint Evo and I don't see a way to close them out. I know that battery life can always be helped, and I would hate to leave them running all day just sucking the life out of the phone if they don't have to be.

View 18 Replies View Related

Android :: Different Behavior When Exiting Application Using BACK And HOME?

Mar 5, 2009

Say a user runs my app from the HOME screen. The app has 3 tabs. Say he/she selectes a different tab, so he/she is in a different screen (same task). Now - if the user presses BACK - the device returns to the HOME screen. If the user launches my app again - the default tab is shown. BUT - if the user presses HOME - the device returns to the HOME screen (same). If the user launches my app again - the OTHER tab is shown.

I understand (sort of) the logic - BACK returns to previous app, popping my app from the history stack, so when launched again - it is started from scratch. But this is confusing my customers - they say it's a bug ! They dont understand the different between two keys doing the same thing as far as they see (returning to HOME). Moreover - I see a different behavior with the built-in DIALER app - I change tabs, press HOME, launch the app again - and it starts with the default tab.

View 11 Replies View Related

Android :: Cannot Stop Soundpool Loop Even After Exiting Application

Nov 4, 2010

I have a timer thread setup to play a loop using soundpool, but for some reason I cannot get _soundPool.stop(_playbackTimer); to stop the loop. even if I exit the application the loop keeps running. I have to physically power off the phone to get it to stop. am I missing something here? Does anyone have any experience with this? I have searched with no resolution. below is a snippet.

if(timeLeft>0 && timeLeft<20 && ticking == false){ _soundPool.play(_playbackTimer, 0.3f, 0.3f, 0, -1, 1); ticking=true; }
if(timeLeft==0 || timeLeft>20){ _soundPool.stop(_playbackTimer); ticking=false; }

View 2 Replies View Related

Android :: Application Manager Not Exiting Properly In Eclair 2.1

Feb 9, 2010

With Android Eclair 2.1 on ARM-based target, we are executing Instrumentation test application from command line:

am instrument -e class android.app.foo. -w com.android.cts.foo.MyTestApp/android.test.InstrumentationTestRunner

Test application executes fine, showing result of the sub-tests in the MyTestApp. But, Application Manager is not exiting properly. This is observed from "ps" command output:

1114 0 52328 S app_process /system/bin com.android.commands.am.Am in....

Due to this issue, we are not able to execute the test applications in shell script.

View 3 Replies View Related

Android :: Application Restarts When Exiting With Back Button

Dec 30, 2009

Does anybody have any insight as to why a game appliction would restart when exiting with the back button. It does not automatically restart when using the Home button to exit and this only occurs one time (after the second attempt to exit with the back button, it exits cleanly). Also, I can reproduce this consistently on the Motorola Droid, but have not been able to reproduce on the G1 or the emulator running 2.0. I've tried changing the launchMode of my activities, but have not found something that works. These are my activities:

1. Splash Screen, Single Instance, Main/Launcher 2. Help, Single Instance 3. High Score, Single Top 4. Preferences, Single Top 5. Options, Single Top 6. Game, Single Top, with SurfaceView

The steps to reproduce the problem are: 1. User starts application, launching Splash Screen Activity 2. User starts game, launching Game Activity 3. Game Activity launches Options Activity (for result) 4. Game Activity restarts with result and game begins. 5. Pressing Back Button returns to Splash Screen Activity 6. Pressing Back Button again, briefly shows home screen, then relaunches Game Activity which starts Options Acitivity 7. Pressing Back Button again finally shows the home screen

View 2 Replies View Related

Android :: Any Way To Kill Threads Those Are In Sleep Mode / While Exiting Application

Feb 18, 2009

the thread sleeped not killed and it wakes up after 10 sec and try to post message and it causes exception. is there any way to kill the threads those are in sleep mode while exiting the application?

View 5 Replies View Related

Exiting Main Thread

Feb 7, 2014

I am trying to connect to a database, and I understand that it has to be outside of the main thread but i thought that this is what my code was doing...apparently not because i keep getting the error: android.os.NetworkOnMainThreadException.

package com.example.dbtesting;
import java.sql.*;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
[code]....

View 1 Replies View Related

HTC Desire :: Sound Coming Out After Exiting Game

May 9, 2010

I have midnight bowling installed, and when I play it works, but when I stop (press home button) I get the game sound after a while, so it is still running in the background. There is no exit button in this game, so how do I stop it then? cause it's eating my battery alive :-)

View 3 Replies View Related

Samsung Moment :: Exiting Download Mode

May 13, 2010

After wasting over an hour trying to update to 2.1, I've given up on trying to get the drivers to work, but now my phone is stuck in Download Mode. Is there a way to get out of this, and turn my phone back on, so I can use it for now, before taking it to the Sprint store tomorrow to have them do the update?

View 2 Replies View Related

Sprint HTC Hero :: Reboot When Exiting Browser?

Jul 4, 2010

I've notice recently my Hero has been acting up, almost as if it is rebooting. However, I don't believe it is a full reboo, i.e. no sprint logo during boot. Only occurs when exiting out from the internet browser. As soon as you hit the home screen to exit, the phone returns to the white htc load page. It appears like it is the full reboot but it does not move next to the Sprint/Now pages. Next the desktop appears but it is grayed out (i.e. my desktop still shows but grayed out, no icons or widgets showen) and the spinning loading icon shows up. Once it finishes loading things appear back to normal. Almost makes me wonder if this reboot is more like sense rebooting and not the entire phone/system. Not sure if this is possible but I want to get anyone's thoughts and if anyone else had expirenced this.

View 12 Replies View Related

General :: After Exiting Any App Home Screen Does Not Turn Black

Jan 16, 2013

Anytime i am done using my phone it stays on unless i black it out by hitting the power button. shouldn't it do this automatically? If i get a text in the middle of the night it stays lit up killing my battery, how do i stop this?

View 1 Replies View Related

HTC Incredible :: Applications Exiting Back To Home Screen Automatically?

May 3, 2010

For example when I was using the camera and as soon as a snap a pic it goes back to the home screen, not all the time, but annoying nonetheless. It just did that when I was using google maps also.

View 1 Replies View Related

General :: Browser Keeps Exiting - Goes Back To Phone Home Screen

Jul 3, 2013

Browser keeps exiting, but I've only noticed it when I visit a certain page. Nothing comes up as in a force closing it just goes back to my phones home screen. I've tried clearing cache and that didn't work. Its really annoying, & I don't want to have to download another browser thats a last resort for me.

View 1 Replies View Related

Android :: Use VBO On 1.6 SDK And Get A Crash

Feb 22, 2010

I tried to use VBO on 1.6 Android SDK and get a crash whenever I try to give the VBO id free using glDeleteBuffers. The issue has already been filed here: http://code.google.com/p/android/issues/detail?id=4273

Is there any way of giving a VBO id free, then? Otherwise I'm afraid that I can't use VBO because I might run out of graphics memory/buffer IDs.

View 3 Replies View Related

Android :: Dialer App Crash?

Nov 8, 2008

Has anybody else here had any problems with the dialer app locking up when placing or trying to pick up calls? I returned my phone after the 5th time it happened. Just curious if anybody else has had this problem, as I want to wait until this is fixed before getting another G1.

View 4 Replies View Related

Android :: How To Get Crash Logs

Sep 4, 2010

I have an app that is not in the market place (signed with a debug certificate), but would like to get crash log data, whenever my application crashes. Where can I find a log of why my app crashed?

View 3 Replies View Related

Android :: Tracking Down Libdvm Crash

Sep 8, 2009

My app is running into the following crash and I'm having a hard time diagnosing it. We have multiple background threads (including a couple pthreads started via JNI that are making calls back up to Java occasionally), but none of them are reporting errors . Any suggestions on how to go about isolating this? There are no symbols in libdvm, so I've been unable to figure out where the stack trace points. This has happened 3 times so far, with the same stack trace each time.

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

View 9 Replies View Related







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