[android-developers] ACTION_ANSWER never answers the call - phone state stays RINGING..

2008-12-11 Thread dreamerBoy

code:

  try
  {
 // answer the phone
 Intent myIntent = new Intent(Intent.ACTION_ANSWER);
 myIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP //
   | Intent.FLAG_DEBUG_LOG_RESOLUTION //
   | Intent.FLAG_FROM_BACKGROUND //
   | Intent.FLAG_ACTIVITY_NEW_TASK).addCategory
(Intent.CATEGORY_DEFAULT);
 context.startActivity(myIntent);
  }
  catch (Exception e)
  {
 cleanup();
 return;
  }

// May need this intent-filter stanza as well
// 
// 
// 
// 


This is called from an ordinary ("raw") thread.  I simulate an
incoming call with:



> telnet localhost 5554
> gsm call 1234567

Phone rings and rings but Answer Activity never picks up - phone state
never goes to OFF_HOOK.
--~--~-~--~~~---~--~~
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
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] ACTION_ANSWER

2008-12-07 Thread legerb

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



[android-developers] ACTION_ANSWER

2008-09-10 Thread Jose María González

I am trying to automatically answer an incoming call.
I am using the intent ACTION_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
-~--~~~~--~~--~--~---