I try to develope a simple Broadcastreceiver. Here's my code: public class MyClass extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { // TODO Auto-generated method stub Bundle extras = intent.getExtras(); if (extras != null) { String state = extras.getString(TelephonyManager.EXTRA_STATE); Log.w("DEBUG", state); if (state.equals(TelephonyManager.EXTRA_STATE_RINGING)) { String phoneNumber = extras .getString(TelephonyManager.EXTRA_INCOMING_NUMBER); Toast.makeText(context, phoneNumber, Toast.LENGTH_LONG).show(); Log.w("DEBUG", phoneNumber); } } } } Manifest.xml: <uses-sdk android:minSdkVersion="10" /> <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" > ...
Cisco Certified Network Associate Exam,640-802 CCNA All Answers ~100/100. Daily update