I need (if its possible) to add an ability to my project to be run when user enters a code such as #1234# in dialer. I\'m not sure it is possible. Currently when i lunc
The accepted answer by Priyank is right. I just wanted to point out some corrections in the code in the Intent class
@Override
public void onReceive(Context context, final Intent intent) {
if (intent.getAction().equals(Intent.ACTION_NEW_OUTGOING_CALL)){
String phoneNumber = intent.getExtras().getString(Intent.EXTRA_PHONE_NUMBER);
if(phoneNumber.equals("#1234#")){
Intent intent1 = new Intent(context, YourActivity.class);
intent1.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent1);
}
}
}