I initiate a new challenge from my activity. And trying to convey an extra boolean.
public class CallInitiatingActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + number)); intent.putExtra("com.demoapp.CUSTOM_CALL", true); startActivity(intent); } }
I also have a registered BroadcastReceiver that listens for outgoing calls:
<receiver android:name=".OutgoingCallListener" android:exported="true" > <intent-filter android:priority="0" > <action android:name="android.intent.action.NEW_OUTGOING_CALL" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </receiver>
Basically, what I expect onReceive to see my additional ones, but for some reason is not passed:
public class OutgoingCallListener extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { Bundle extras = intent.getExtras(); for (String key : extras.keySet()) { Log.i(Constant.LOG_TAG, key + ": " + extras.get(key)); } } }
Output:
android.phone.extra.ALREADY_CALLED:false android.intent.extra.PHONE_NUMBER:+370652xxxxx com.htc.calendar.event_uri:null android.phone.extra.ORIGINAL_URI:tel:+370652xxxxx
source share