<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: shiv</title>
    <description>The latest articles on DEV Community by shiv (@shivu14291).</description>
    <link>https://dev.to/shivu14291</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F883947%2Fdeca7bf8-3128-4091-a955-6236a8e781d9.png</url>
      <title>DEV Community: shiv</title>
      <link>https://dev.to/shivu14291</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shivu14291"/>
    <language>en</language>
    <item>
      <title>How to reject incoming call in xamarin android</title>
      <dc:creator>shiv</dc:creator>
      <pubDate>Tue, 28 Jun 2022 11:01:37 +0000</pubDate>
      <link>https://dev.to/shivu14291/how-to-reject-incoming-call-in-xamarin-android-3dac</link>
      <guid>https://dev.to/shivu14291/how-to-reject-incoming-call-in-xamarin-android-3dac</guid>
      <description>&lt;p&gt;how to reject incoming call ...? Please suggest me the right way. &lt;br&gt;
I have the following working code to get the incoming call number. After that, I'm not getting which service to use to end the call.&lt;br&gt;
using Android.App;&lt;br&gt;
using Android.Content;&lt;br&gt;
using Android.Provider;&lt;br&gt;
using Android.Runtime;&lt;br&gt;
using Android.Telecom;&lt;br&gt;
using Android.Telephony;&lt;br&gt;
using Android.Widget;&lt;br&gt;
using Java.Lang;&lt;br&gt;
using Java.Lang.Reflect;&lt;br&gt;
using System;&lt;br&gt;
using Exception = Java.Lang.Exception;&lt;/p&gt;

&lt;p&gt;namespace CallManger&lt;br&gt;
{&lt;br&gt;
    [BroadcastReceiver(Enabled = true, Exported = true)]&lt;br&gt;
    [IntentFilter(new[] { TelephonyManager.ActionPhoneStateChanged })]&lt;br&gt;
    public class IncomingCallReceiver : BroadcastReceiver&lt;br&gt;
    {&lt;br&gt;
        public override void OnReceive(Context context, Intent intent)&lt;br&gt;
        {&lt;br&gt;
            if (intent.Action == TelephonyManager.ActionPhoneStateChanged)&lt;br&gt;
            {&lt;br&gt;
                var state = intent.GetStringExtra(TelephonyManager.ExtraState);&lt;br&gt;
                if (state == TelephonyManager.ExtraStateRinging)&lt;br&gt;
                {&lt;br&gt;
                    var number = intent.GetStringExtra(TelephonyManager.ExtraIncomingNumber);&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                //Reject incoming call code should go here

            }
        }
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;br&gt;
}&lt;/p&gt;

</description>
      <category>xamarin</category>
    </item>
  </channel>
</rss>
