Application Pause on incoming call

Tutorials with advanced 'difficulty' and more Lines of Code.

Application Pause on incoming call

Postby aniket.kulkarni » Fri Nov 12, 2010 7:20 am

Hello everyone,
I have an application which consists of 8-10 activities.Suppose i receive an incoming call while running any one of these activities from my application.So how to pause my on going activity(may be anyone out of 8-10)and resume the application after the call finished?Right now my application gets force closed..I would be glad if i can get any sample code!!!
Thanks in advance,

Aniket
aniket.kulkarni
Freshman
Freshman
 
Posts: 9
Joined: Fri Nov 12, 2010 6:54 am

Top

Re: Application Pause on incoming call

Postby Schermvlieger » Fri Nov 12, 2010 9:27 am

Hi Aniket,

You should really check the logcat to find out why your application is force-closing, as Android handles application switching between whatever app is handling the call and yours, and you don't really have to do anything special to handle this situation.

Also, have a look at the monkey tool; it will help you find these kind of problems in your coding.
Schermvlieger
Senior Developer
Senior Developer
 
Posts: 159
Joined: Fri Feb 26, 2010 1:37 pm

Re: Application Pause on incoming call

Postby aniket.kulkarni » Fri Nov 12, 2010 11:25 am

To Schermvlieger,
Thanks a lot.I didnt knew that, Thought that i have to handle the situation so i tried to catch that event with a broadcast receiver.Hence was the null pointer exception..I removed that part and rerun the application.It is running fine now.The particular activity that was running previously is launched again by the android OS.Hats off to the developers of this OS.
aniket.kulkarni
Freshman
Freshman
 
Posts: 9
Joined: Fri Nov 12, 2010 6:54 am

Re: Application Pause on incoming call

Postby AfzalivE » Sat Nov 13, 2010 11:13 am

I believe onPause, onResume and onStop are for that purpose?
AfzalivE
Freshman
Freshman
 
Posts: 5
Joined: Sat Nov 13, 2010 10:53 am

Top

Return to Advanced Tutorials

Who is online

Users browsing this forum: No registered users and 3 guests