call handling ?

Put your problem here if it does not fit any of the other categories.

call handling ?

Postby eden91940 » Thu Apr 23, 2009 2:11 pm

How do i stop incoming calls ?

Ive got the following snippet to complete :


Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. TelephonyManager tm = (TelephonyManager)this.getSystemService(Context.TELEPHONY_SERVICE);
  2.  
  3. tm.listen(this, CallStateListener.LISTEN_CALL_STATE);
  4.  
  5.  
  6.  
  7. public void onCallStateChanged(int state, String incomingNumber)
  8.  
  9. {
  10.  
  11.     switch(state)
  12.  
  13.     {
  14.  
  15.           case TelephonyManager.CALL_STATE_DLE:
  16.  
  17.                Log.d(DEBUG, "PHONE STATE - IDLE");
  18.  
  19.                break;
  20.  
  21.           case TelephonyManager.CALL_STATE_OFFHOOK:
  22.  
  23.                Log.d(DEBUG, "PHONE STATE - OFFHOOK");
  24.  
  25.                break;
  26.  
  27.           case TelephonyManager.CALL_STATE_RINGING:
  28.  
  29.                Log.d(DEBUG, "PHONE STATE - RINGING");
  30.  
  31.                break;
  32.  
  33.      }
  34.  
  35. }
Parsed in 0.032 seconds, using GeSHi 1.0.8.4




thx
eden91940
Freshman
Freshman
 
Posts: 5
Joined: Tue Apr 21, 2009 11:45 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 28 guests