Thanks for your support @dan, I was able to achieve the goal with the following step:
- Define a
BroadcastReceiver
class that will receive the intent. In this class, override theonReceive()
method to perform the desired action when the intent is received. For example:
public class MyReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
// Perform action here
}
}
- In the app’s manifest file, declare the
BroadcastReceiver
with an<intent-filter>
that specifies the action and package name of the external app. For example:
<receiver android:name=".MyReceiver">
<intent-filter>
<action android:name="com.example.MY_ACTION" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="package" android:path="uk.org.xibo.client" />
</intent-filter>
</receiver>
- In the app’s code, register the
BroadcastReceiver
with theIntentFilter
that matches the action string used by the external app. For example:
MyReceiver receiver = new MyReceiver();
IntentFilter filter = new IntentFilter("com.example.MY_ACTION");
registerReceiver(receiver, filter);
- Setup Xibo Action Bar Mode & Intent like this: