spectrumsofttech
asked on
Phone Call in Android
I used following code for phone call.But the call is not working .can anyone help me? I also given manfest Call Phone permission.
call = (TextView) findViewById(R.id.GuestPho neNo1);
call.setOnClickListener(ne w View.OnClickListener() {
@Override
public void onClick(View view) {
String no = call.getText().toString();
// Toast.makeText(Accepted_De tails.this , no, Toast.LENGTH_SHORT).show() ;
Intent callIntent = new Intent(Intent.ACTION_CALL) ;
callIntent.setData(Uri.par se("tel:" + no));
/*if (ActivityCompat.checkSelfP ermission( Accepted_D etails.thi s, Manifest.permission.CALL_P HONE) != PackageManager.PERMISSION_ GRANTED) {
// TODO: Consider calling
// ActivityCompat#requestPerm issions
// 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#requestPerm issions for more details.
return;
}*/
startActivity(callIntent);
}
});
call = (TextView) findViewById(R.id.GuestPho
call.setOnClickListener(ne
@Override
public void onClick(View view) {
String no = call.getText().toString();
// Toast.makeText(Accepted_De
Intent callIntent = new Intent(Intent.ACTION_CALL)
callIntent.setData(Uri.par
/*if (ActivityCompat.checkSelfP
// TODO: Consider calling
// ActivityCompat#requestPerm
// here to request the missing permissions, and then overriding
// public void onRequestPermissionsResult
// int[] grantResults)
// to handle the case where the user grants the permission. See the documentation
// for ActivityCompat#requestPerm
return;
}*/
startActivity(callIntent);
}
});
This question needs an answer!
Become an EE member today
7 DAY FREE TRIALMembers can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Open in new window
source: https://stackoverflow.com/questions/50386017/phone-call-in-android