Callback from BroadcastReceiver beetwen Apps?

I want to allow other Apps to integrate with mine and I'm writing a dummy "consumer" app but I cant achieve to return a callback to notify the "consumer" app if everything went well.

So my DUMMY_APP has a simple layout with 2 buttons a success call, and a call with a wrong EXTRA param. To make DUMMY_APP to call MAIN_APP I use sendBroadcast

// MainActivity class

private static final String REQUIRED_ACTION = "com.basetis.afr.intent.action.INIT_TEXT_FLOW";

    Button btnSuccess = (Button)findViewById(;
    btnSuccess.setOnClickListener(new View.OnClickListener() {
        public void onClick(View view) {
            i.putExtra(Intent.EXTRA_TEXT, textToBeRead);

So MAIN_APP has the corresponding BroadcastReceiver that is receiving fine.

// BlinkingReadReceiver class
private static final String CALLBACK_CALL_AFR_ACTION = "com.basetis.afr.intent.action.CALLBACK_CALL_AFR_ACTION";

public void onReceive(Context context, Intent intent) {
    Intent i = new Intent();

    Log.d(TAG, "SUCCESS send callback");


So the DUMMY_APP BroadcastReceiver never receive nothing :(

So I configured Manifests like that:


        <receiver android:name=".MainBroadcastReceiver" android:enabled="true">
                <action android:name="com.basetis.afr.intent.action.CALLBACK_CALL_AFR_ACTION"></action>


    <receiver android:name=".BlinkingReadReceiver" android:enabled="true">
            <action android:name="com.basetis.afr.intent.action.INIT_TEXT_FLOW"></action>

Sometimes I receive this error (afrsender is de DUMMY_APP) but seems sort of random...

Performing stop of activity that is not resumed: {com.basetis.afrsender.afrsender/com.basetis.afrsender.afrsender.MainActivity}
java.lang.RuntimeException: Performing stop of activity that is not resumed

Any suggestions about how to achieve this two way App communication?

Thank you very much.


As stated in the document

Starting from Android 3.1, the system's package manager keeps track of applications 
that are in a stopped state and provides a means of controlling their launch from 
background processes and other applications.

That means that till the app is not started manually by the user your app will be in force stop state and it won't receive any broadcast. That's why your dummy app is not receiving and broadcast sent by main app. Check here for more reference

Need Your Help

How to open multiple consoles in multiple tabs in Eclipse?

java eclipse console perspective

I am using Eclipse Version: Helios Release for a Java application. I need to run multiple instances of same application and want easy visibility of multiple consoles.

Oracle's pro*C compiler and gnu C (__builtin_va_list, __attribute__, etc)

c oracle compilation gnu oracle-pro-c

I'm compiling a database library with proC which converts the .ppc library file to a .c file that gcc can use. However, I'm getting a lot of errors in proC like the following