How to send a sms before receive a call

view story

http://stackoverflow.com – I use this code to send a sms to the incoming number before receiving this call, but it does not work correctly.. public class check extends BroadcastReceiver { Context context = null; private static final String TAG = "Phone call"; private ITelephony telephonyService; @Override public void onReceive(Context context, Intent intent) { Log.v(TAG, "Receving...."); TelephonyManager telephony = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); try { Class c = Class.forName(telephony.getClass().getName()); Method m = c (HowTos)