Create button to call specific number - Android Studio
<p>I know this question has been answered a couple of times on here but I am having a slightly bigger issue with the problem as Android Studio is giving me errors I have not come across before (I am new at android programming).</p>

<p>Inside the <code>AndroidManifest.xml</code> I have the following code:</p>

<pre><code>&lt;uses-permission android:name="android.permission.CALL_PHONE"&gt;&lt;/uses-permission&gt;   
</code></pre>

<p>Inside the java class I have the following code:</p>

<pre><code>Intent callIntent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:123456789"));
startActivity(callIntent);
</code></pre>

<p>My problem is that the <code>startActivity(callIntent);</code> is giving me the following error:</p>

<p><a href="https://i.stack.imgur.com/xKvJV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xKvJV.png" alt="enter image description here"></a></p>

<p>Which then lead Android Studio to add this:</p>

<pre><code>Intent callIntent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:123456789"));
            if (ActivityCompat.checkSelfPermission(this, Manifest.permission.CALL_PHONE) != PackageManager.PERMISSION_GRANTED) {
                // TODO: Consider calling
                //    ActivityCompat#requestPermissions
                // here to request the missing permissions, and then overriding
                //   public void onRequestPermissionsResult(int requestCode, String[] permissions,
                //                                          int[] grantResults)
                // to handle the case where the user grants the permission. See the documentation
                // for ActivityCompat#requestPermissions for more details.
                return;
            }
            startActivity(callIntent);
</code></pre>

<p>Android studio then gave one last error which was:</p>

<p><a href="https://i.stack.imgur.com/jfUFE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jfUFE.png" alt="enter image description here"></a></p>

<p>I don't know what I am doing wrong here, could someone please help? </p>