I want to implement my BroadcastReceiver
on pressing some key combination
(say if i dial 1234 from my keypad) them my BroadcastReceiver
will be called. By which i can launch my activity ?
Here is how i fixed this
Here is how i fixed this
public class MyKeypadListener extends BroadcastReceiver{
@Override
public void onReceive(Context context, Intent intent) {
// TODO Auto-generated method stub
if (intent.getAction().equals(Intent.ACTION_NEW_OUTGOING_CALL)) {
String number = getResultData();
if (number!=null) {
if(number.equals("1234")){
setResultData(null);
Intent newintent = new Intent(context,SettingsActivity.class);
newintent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(newintent);
}
}
}
}
}
and in the manifest i hv added..
**<receiver android:name=".receivers.MyKeypadListener">
<intent-filter >
<action android:name="android.intent.action.NEW_OUTGOING_CALL"/>
<action android:name="android.intent.action.PHONE_STATE"/>
</intent-filter>
</receiver>**