We're using an android application to do some assessments, when an assessor arrives on site they need to login with the office on the call. Theres a reference number I'd really like to be able to keep on the phone display once they ring in.
What would be perfect is a dialog that says the number on top of the dialer screen.
I've tried to do this, but it just overtakes the dialog and shows the calling screen. Is there anyway to push the dialer to the background and continue to show the user the dialog?
Heres what I have so far:
public void makecall(View view){
try {
Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:NUMBER"));
startActivity(callIntent);
Toast.makeText(getApplicationContext(), "TEST",Toast.LENGTH_LONG).show();
AlertDialog.Builder adb = new AlertDialog.Builder(this);
adb.setTitle("Alert");
adb.setMessage("Client Reference Blah Blah");
adb.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
}
});
adb.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
});
adb.show();
} catch (ActivityNotFoundException activityException) {
Throwable e = null;
Log.e("helloandroid dialing example", "Callfailed", e);
}
}