Skip to main content
Samsung Developer Program

Managing RN Action Callbacks

Your Android™ app can set CallbackIntent to receive one of three types of callbacks after RN actions are processed:

  • ActivityCallback will perform context.startActivity() on the Android device with Intent.FLAG_ACTIVITY_NEW_TASK.
  • BroadcastCallback will perform context.sendBroadcast().
  • ServiceCallback will perform context.startService().

Your Android app can retrieve the information like user type when the action is RemoteInputAction and it has KeyboardInputMode. The passed intent has a string extra named extra_action_data.

To call a method when an activity is created:

public class MainActivity extends Activity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
       String result = getIntent().getStringExtra("extra_action_data");
       if (result != null) {

           ...

       }
    }
}

To increase component security:

<activity
    android:name=”MainActivity”
    android:permission=”com.samsung.accessory.permission.ACCESS_CALLBACK” />