SaravanaKumar
SaravanaKumar

Reputation: 747

Handling Incoming Call in windows Phone 8 while Playing Game?

Anyone tell me that how could i get the control in windows phone 8 when receiving incoming call while playing the game??

Is that any functions to be triggered when getting incoming call?

Please someone help to solve this issue?

Upvotes: 2

Views: 896

Answers (2)

SaravanaKumar
SaravanaKumar

Reputation: 747

If anyone having this same issue Following will be the solution If You are using Unity Engine.

//For interrupt handling
 private bool isGameInterrupted;

void OnApplicationPause(bool isInterrupted)
 {
    if( !isGameInterrupted && isInterrupted )
     {   
      isGameInterrupted = true;
     }  

    if( isGameInterrupted )
    {    
     // Call your pause screen here //   
     isGameInterrupted = false;
    }
 }

Upvotes: 2

ZombieSheep
ZombieSheep

Reputation: 29953

Not sure what you're asking, but it sounds like you are misunderstanding the way things work in the phone.

If a call comes in while the user is playing your game, you don't have any kind of control over that. The phone will pop up the "incoming call" ui and take over control. At this point your app will get put into the background. At this point, your standard lifecycle management will come into play (suspend/reactivate/etc.). Once the call finishes, control will be returned to your game and you can pick up where you left off.

There's a decent overview of how this all works here or here. These are both specific to Phone 7.x, but the principle is the same in 8.

Upvotes: 1

Related Questions