App crashes after clicking ad

Put your problem here if it does not fit any of the other categories.

App crashes after clicking ad

Postby timg530 » Thu Feb 10, 2011 2:28 am

Hey guys, I am using admob for ads in my app. However, after the ad is clicked and the browser is open, I am having issues getting back to app without it crashing. I'll usually just hit the back button and I get a crash error. I feel like this may have something to do with saveInstance and restoreInstance in the activity, but I messed around with those and couldn't figure out how to fix the issue. Any ideas or guidance? Thanks.
timg530
Junior Developer
Junior Developer
 
Posts: 12
Joined: Tue Feb 08, 2011 12:36 am

Top

Re: App crashes after clicking ad

Postby wakawaka » Thu Feb 10, 2011 1:10 pm

Any pointer?
Android Development Tutorials and Code Snippets: http://forum.gssdaily.com/
wakawaka
Experienced Developer
Experienced Developer
 
Posts: 79
Joined: Tue Jan 11, 2011 1:51 pm

Re: App crashes after clicking ad

Postby azekrot » Thu Feb 10, 2011 6:27 pm

Run adb logcat.
azekrot
Developer
Developer
 
Posts: 49
Joined: Thu Sep 02, 2010 7:58 pm

Re: App crashes after clicking ad

Postby timg530 » Fri Feb 11, 2011 10:56 pm

azekrot wrote:Run adb logcat.


Sorry, should've posted the logcat with my original post. It is attached in a txt document to this post.

It only contains Debug info after I clicked ad. During this I clicked the back button while the browser was open.

wakawaka wrote:Any pointer?


What do you mean any pointer?
Attachments
logSmall.txt
(7.47 KiB) Downloaded 23 times
timg530
Junior Developer
Junior Developer
 
Posts: 12
Joined: Tue Feb 08, 2011 12:36 am

Re: App crashes after clicking ad

Postby azekrot » Sat Feb 12, 2011 7:12 pm

This seems to be the culprit:
02-11 16:47:24.036: ERROR/AndroidRuntime(226): Uncaught handler: thread main exiting due to uncaught exception
02-11 16:47:24.175: ERROR/AndroidRuntime(226): java.lang.IllegalThreadStateException: Thread already started.
02-11 16:47:24.175: ERROR/AndroidRuntime(226): at java.lang.Thread.start(Thread.java:1322)
02-11 16:47:24.175: ERROR/AndroidRuntime(226): at com.geodetest.rocketdeftest.RocketView.surfaceCreated(RocketView.java:1871)
azekrot
Developer
Developer
 
Posts: 49
Joined: Thu Sep 02, 2010 7:58 pm

Re: App crashes after clicking ad

Postby timg530 » Sun Feb 13, 2011 6:56 am

Thanks a ton. I'm surprised I didn't catch that before. Well I put try-catch blocks around everything and found the problem. The actual error is "Thread is already starterd". It happens on the surfaceCreated method, which calls thread.start(). I have a question about standard procedure here. Do most people just shut down the app when the ad is clicked? Or do they just suspend it so it can be restarted later? I'm having issues trying to suspend it and resume it properly. I have a pause and unpause function that work fine. But I am having issues handling the surface getting destroyed and then recreated when the ad is clicked and the back button is pressed. Thanks.
timg530
Junior Developer
Junior Developer
 
Posts: 12
Joined: Tue Feb 08, 2011 12:36 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 24 guests