Android: A Toast when OutComing call

Posted by Skatephone on Stack Overflow See other posts from Stack Overflow or by Skatephone
Published on 2010-12-28T11:43:03Z Indexed on 2010/12/28 11:54 UTC
Read the original article Hit count: 417

Filed under:
|
|

Hi, i'm trying this code found on internet...it should show a toast for OutComing call event using a BroadcastReceiver but on my htc tattoo with Android 1.6 it doesn't works (it don't show any toast)

public class HFBroadcastOutComingRecevier extends BroadcastReceiver{

@Override public void onReceive(Context context, Intent intent) {

 Toast.makeText(context, "Phone Event", Toast.LENGTH_SHORT).show();

 Bundle bundle = intent.getExtras();
 if(null == bundle)
       return;
 String phonenumber = intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER);
 String info = "Detect Calls sample application\nOutgoing number: " + phonenumber;
    Toast.makeText(context, info, Toast.LENGTH_LONG).show();

} }

Naturally i've registered the BroadcastReceiver on my Manifest as:

and with this permissions:

  <uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS"/>

Any idea?

© Stack Overflow or respective owner

Related posts about android

Related posts about call