Mike Winter
Lurker
Hi
I am new to Android App development, so excuse me if I make some mistakes!
I am trying to write an app that will make a phone call when you click a 'Connect' button. What I have done so far is working, however, when you click the Connect button, the Android phone app opens up on top of my app. My app is still there - you can switch back to it. I want my app to keep the focus - is it possible to suppress the android phone app from showing, or do I need to make a call a different way?
My code is shown below:
int checkPermission = ContextCompat.checkSelfPermission(MainActivity.this, Manifest.permission.CALL_PHONE);
if (checkPermission == PackageManager.PERMISSION_GRANTED) {
startActivity(new Intent(Intent.ACTION_CALL , Uri.parse("tel:07XXXXXXXXX")));
}
else{
ActivityCompat.requestPermissions(MainActivity.this, new String[]{Manifest.permission.CALL_PHONE}, 1);
}
Hope I have made what I want to do clear! Thanks in advance for any advice!
Mike
I am new to Android App development, so excuse me if I make some mistakes!
I am trying to write an app that will make a phone call when you click a 'Connect' button. What I have done so far is working, however, when you click the Connect button, the Android phone app opens up on top of my app. My app is still there - you can switch back to it. I want my app to keep the focus - is it possible to suppress the android phone app from showing, or do I need to make a call a different way?
My code is shown below:
int checkPermission = ContextCompat.checkSelfPermission(MainActivity.this, Manifest.permission.CALL_PHONE);
if (checkPermission == PackageManager.PERMISSION_GRANTED) {
startActivity(new Intent(Intent.ACTION_CALL , Uri.parse("tel:07XXXXXXXXX")));
}
else{
ActivityCompat.requestPermissions(MainActivity.this, new String[]{Manifest.permission.CALL_PHONE}, 1);
}
Hope I have made what I want to do clear! Thanks in advance for any advice!
Mike