For something like a 'help I can't get up' app -- is there a way for a user to set a contact number, and then for the app to call that number in the future WITHOUT the user initiating the dialout? I've tried the below but there seems to be a problem:
private void callPhone(){
if(phoneNumber.length()>0){
try {
Intent intent = new Intent(Intent.ACTION_CALL);
intent.setData(Uri.parse("tel:"+phoneNumber));
startActivity(intent);
} catch (Exception e) {
Toast.makeText(getApplicationContext(), "Problem calling number.", Toast.LENGTH_LONG).show();
}
//startActivityForResult(new Intent(Intent.ACTION_CALL, Uri.parse("tel:+"+phoneNumber)), 1);
}
}