If you have already defined your broadcast receive class, the next step is to register it with the Activity / Service that you want to receive for translation. Registration example:
IntentFilter iFilter = new IntentFilter(); iFilter.addAction("com.example");
If you destroy an action / service, for best practice, be sure to unregister the broadcast receiver for the same activity / service:
@Override protected void onDestroy() { if(myReceiver!=null) unregisterReceiver(myReceiver) super.onDestroy(); }
MyReceiver Class:
public class MyReceiver extends BroadcastReceiver{ @Override public void onReceive(Context arg0, Intent intent) { if(intent.getAction().equals("com.example")){
Muhammad abdullah
source share