I've also tried to use ACTION_ANSWER, but i keep getting the
"ActivityNotFoundException".
Does it mean that the Phone app is not registered for this intent?
What is the purpose of ACTION_ANSWER then?


---------- Forwarded message ----------
From: Jose María González <[EMAIL PROTECTED]>
Date: Sep 10, 5:04 pm
Subject: ACTION_ANSWER
To: Android Developers


I am trying to automatically answer an incoming call.
I am using the intentACTION_ANSWER, but when a call arrives I can
only see an IndexOurOfBoundsException from JavaBinder. According to
the documentation it is possible to answer the call, but I cannot make
it.

Here is my code

public class MyPhoneStateListener extends PhoneStateListener {
        Context context;
        @Override
        public void onCallStateChanged(int state,String incomingNumber)
{
                 if (state==1){
                         Intent ic = new Intent(Intent.ACTION_ANSWER);
                         context.startActivity(ic);
                 }}

---Main class :

public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        TelephonyManager telephonyManager
=(TelephonyManager)getSystemService(TELEPHONY_SERVICE);
        telephonyManager.listen(phoneListener,
PhoneStateListener.LISTEN_CALL_STATE);
        phoneListener.context=this;
     }

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
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