We have an activity that we are trying to trigger as a customer facing activity but its not working.
Here's the code in our activity that calls the customer facing activity:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); remoteDeviceConnector = new RemoteDeviceConnector(this, CloverCount.getAccount(this)); } @Override public void onPause() { //super.onPause(); //finish(); super.onPause(); executor.execute(()->{ remoteDeviceConnector.sendMessageToActivity(new MessageToActivity(CUSTOM_ACTIVITY_NAME, "FINISH")); remoteDeviceConnector.disconnect(); }); } public void onResume() { super.onResume(); final String payload = "{\"msg\"=\"Initial...\"}"; // if you need an inital payload final CustomActivityRequest car = new CustomActivityRequest(CUSTOM_ACTIVITY_NAME, payload); executor.execute(()->{ remoteDeviceConnector.resetDevice(new ResetDeviceRequest()); remoteDeviceConnector.startCustomActivity(car, new CustomActivityListener(){ @Override public void onMessageFromActivity(MessageFromActivity message) { // handle message from the CustomActivity } @Override public void onCustomActivityResult(CustomActivityResponse response) { // handle the result of the CustomActivity } }); }); }
and here's the manifest:
<activity android:name=".SaleDialogActivityCF" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"> <intent-filter> <action android:name="com.yourdomain.ACTIVITY_NAME"/> <category android:name="com.clover.cfp.ACTIVITY"/> <category android:name="android.intent.category.DEFAULT"/> </intent-filter> </activity>
and lastly the activity that's called:
private static final String CUSTOM_ACTIVITY_NAME = ".SaleDialogActivityCF";