Hi everybody,
I'm trying to end a call after a few seconds, I would make a missed
call, but no way. With setResultData(null) the call is ended without
problems but it does just before the call.
I tried to use thread and not work, and now I'm trying to use
CountdownTimer and despite running the code does not end the call.

This is my code:
[code]
public class receiver extends BroadcastReceiver {
    Context cont;
    @Override
    public void onReceive(Context context, Intent intent) {
        String action = intent.getAction();
        cont = context;
        if(action.equals("android.intent.action.NEW_OUTGOING_CALL"))
        {
            Toast.makeText(context, "Count",
Toast.LENGTH_SHORT).show();
            MyCount counter = new MyCount(3000,1000);
            counter.start();
        }
    }

    public class MyCount extends CountDownTimer {
        public MyCount(long millisInFuture, long countDownInterval)
        {
            super(millisInFuture, countDownInterval);
        }

        @Override
        public void onFinish() {
            Toast.makeText(cont, "Finish",
Toast.LENGTH_SHORT).show();
            receiver.this.setResultData(null);
            //setResultData(null);
        }

        @Override
        public void onTick(long millisUntilFinished) {
            Toast.makeText(cont, "Counter: " + millisUntilFinished,
Toast.LENGTH_SHORT).show();
        }
    }
}
[/code]

The problem is in this line
[b]receiver.this.setResultData (null);[/b]
executes but does nothing, does not end the call as it should do ....

Thanks ;)

-- 
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