Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Hi, I want to get the incoming number but I get the error.

$
0
0
[BroadcastReceiver(Enabled =true,Exported = false)]
[IntentFilter(new[] { "android.Content.intent.PHONE_STATE"})]

public class IncomingCallReceiver : BroadcastReceiver
{


    public override void OnReceive(Context context, Intent intent)
    {
        try
        {
            Console.WriteLine("Receiver start");
            // Toast.MakeText(context, " Receiver start ",  ToastLength.Long).Show();
        }
        catch (Exception e)
        {
            Console.WriteLine("Receiver start ex " + e.StackTrace);
        }

}
}

 public void Send()
        {

            var intent = new Intent(this, typeof(IncomingCallReceiver));
            intent.PutExtra("selectedItemId", "item");
            StartActivity(intent);

        }

Unhandled Exception:

Android.Content.ActivityNotFoundException: Unable to find explicit activity class {androidcallerid.androidcallerid/md5db696f9a0e93a8df1577a4f1c7f26166.IncomingCallReceiver}; have you declared this activity in your AndroidManifest.xml?

Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>