Arun
Arun

Reputation: 151

How to return to the main page of the app after a phonenumber is dialled and hence the call is ended?

I am developing a local search app in iPhone...after dialing a phone number from a set of phone number searches i am able to make a call to the selected number..Now what i need is a code or a way to check if the call has ended and the app should return to the page from where i selected the number rather than exiting the app which is happening at present?please help..only this issue is left and then the app is done..so please help..

Upvotes: 3

Views: 846

Answers (4)

Rog
Rog

Reputation: 17170

This is a common problem on iPhone because of the single process model. UIKit will relaunch your app after a call ends but, you need to save the state before your app is terminated and then reload your state when you are relaunched.

You should review this SO question about saving state and relaunching and specifically the Apple sample code for achieving this in the DrillDownSave sample on the iPhone developer site (login required).

Upvotes: 0

oxigen
oxigen

Reputation: 6263

Save your current position before exit app (use NSUserDefaults or DataBase) And check it when app is starting.

Upvotes: 1

Jake
Jake

Reputation: 3973

To extend what the others say;

You can't do this on the iPhone. It allows only one process to run, so you can not make your app run in the background. What Oxigen says is probably your best bet; save the apps. position (navigation wise) and restore the app. to that position once the user starts your app. again.

However, this does require your users to start your app. There is no way of doing this automatically.

Maybe, some day, when the iPhone OS 4.0 comes out, we can actually run background applications.. Lets pray to the Apple gods!

P.S: +1 for the title!

Upvotes: 0

Don McCaughey
Don McCaughey

Reputation: 9972

You can't.

Upvotes: 1

Related Questions