Hi,

is there a way to start new call from BroadcastListener?

I want to intercept current call and make a new call. I have added 
permissions, BroadcastListener to Manifes.xml.

This is how I'm doing this. But nothing happens. Another activity starts, 
but call is not placed.
Should I do it differently?

public class OutgoingCallListener extends BroadcastReceiver {

    @Override
    public void onReceive(Context context, Intent intent) {
        if (conditionsAreMet()) {
            setResultData(null); //terminate current call
            Inetent intent = new Intent(context, CallInitiatingActivity.class)
            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | 
Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
            startActivity(intent);
        }
    }
}


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));
        startActivity(intent);
    }
}


-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to