0

I'm developing two Android applications. The first one calls broadcast receiver from activity. The second one contains broadcast receiver that is called from first application.

I've manage to do broadcast call when it is in the same application with caller activity. But when I take receiver to separate project it doesn't work. What should I change?

user1379574
  • 689
  • 4
  • 11
  • 23

1 Answers1

0

This is how I register receiver:

 <receiver
        android:name=".TestReceiver"
        android:enabled="true" 
        android:exported="true"
        android:process=":deltaFO">
        <intent-filter>
            <action android:name="android.intent.action.BOOT_COMPLETED"/>
            <action android:name="com.myapp.intent.action.FILE_OPERATION" />
        </intent-filter>

    </receiver>

This is how I send intent

Intent intent = new Intent("com.myapp.intent.action.FILE_OPERATION");
        intent.putExtra("operation", operation);
        context.sendBroadcast(intent);

This is class that receives intent:

public class TestReceiver extends BroadcastReceiver{
public final String TAG="TestReceiver";

@Override
public void onReceive(Context context, Intent intent) {
    Log.i(TAG,"EXTERNAL BROADCAST...");

}

}

user1379574
  • 689
  • 4
  • 11
  • 23