How to create/make call button in Android Studio.

Now, we have to implement a JAVA code line which can be as a backend system so we have to put all JAVA code under the onCreate method in the MainActivity.java file given below.

CardView callBtn01 = findViewById(R.id.cardBtn01);
        callBtn01.setOnClickListener(v -> {
            Intent intent = new Intent(Intent.ACTION_DIAL);
            intent.setData(Uri.parse("tel: 1234567890"));
            startActivity(intent);
        });

::: Thank You :::

Scroll to Top