I have an app, where some calls can be made when you press a button.
I call a number with:
Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:"+o.getTel()));
startActivity(callIntent);
I have a broadcast receiver that detects end of call.
But this broadcast receiver also receives calls started from other apps (e.g. dialer app).
How can i differentiate calls started from other apps from calls started in mine?
Tnx
Before you call sendBroadcast(intent), add an extra to the intent,
e.g i.putExtra(“sender”, “my identifier”)
Then in the onReceive of the receiver
String encodedType = intent.getStringExtra(“sender”);
Then you can test for this string.