Android: A Toast when OutComing call
- by Skatephone
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?