Forum Cross Platform with Xamarin


The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

bring application from background to foreground while receiving incoming call via BroadcastReciver

Hi I'm new to Android & Xamarin development,

I have developing a application in xamarin -cross platform app for SIP calling, I have done incoming & outgoing calls. I have a problem with receiving call when app running in background. I tried to bring application to foreground while receive call.

This was code I have used,

In my MainActivity

private void registerReceiver()
 IncomingCallReceiver callReceiver = new IncomingCallReceiver();
 IntentFilter sipIntentFilter = new IntentFilter();
 this.RegisterReceiver(callReceiver, sipIntentFilter);

and in my BroadcastReceiver

public override void OnReceive(Context context, Intent intent)
          DialerCallListener listener = new DialerCallListener(); 
 = SIPRegistration.sipManager.TakeAudioCall(intent, listener);

          Intent newIntent = new Intent(context, typeof(MainActivity));


        PlaySound pSound = new PlaySound();
        pSound .PlayRingtone(context);

      MainActivity.isIncomingCall = true;
      MessagingCenter.Send(string.Empty, "IncomingCall", value);

I tried with different ActivityFlags like NewTask, SingleTop, ReorderToFront, ReceiverForeground, FromBackground, BroughtToFront but noting will bring my app to foreground. what else I want do from here. I have followed this Link . but nothing helped me... Need to add anything in manifest file? please help to fix this.


Sign In or Register to comment.