Professional Documents
Culture Documents
<uses-permission android:name="android.permission.CALL_PHONE"/>
Activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical"
tools:context=".MainActivity">
<EditText
android:id="@+id/phno"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="Enter phone number"
android:inputType="phone"
/>
<Button
android:id="@+id/call"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="CALL"
/>
</LinearLayout>
MainActivity.java
package com.example.r6c;
import androidx.appcompat.app.AppCompatActivity;
import android.net.Uri;
import android.view.View;
import android.widget.EditText;
import android.widget.Button;
import android.content.Intent;
import android.os.Bundle;
}
});
}
}
Output:-