Exchange

How to make direct phone call from my app in android studio






callMobitelBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Toast.makeText(HomeActivity.this, "மொபிட்டலுக்கு அழைக்கின்றது", Toast.LENGTH_SHORT).show();
if(ContextCompat.checkSelfPermission(HomeActivity.this, Manifest.permission.CALL_PHONE) != PackageManager.PERMISSION_GRANTED){
ActivityCompat.requestPermissions(HomeActivity.this, new String[]{Manifest.permission.CALL_PHONE}, 1);
}else {
String dial = "tel:0704*****2";
startActivity(new Intent(Intent.ACTION_CALL, Uri.parse(dial)));
callDialog.dismiss();
}
}
});




Post a Comment

0 Comments