@Override
  public void onCreate() {
    super.onCreate();

    mHandler = new Handler(Looper.getMainLooper());
    DJISDKManager.getInstance().initSDKManager(this, mDJISDKManagerCallback);
  }
        @Override
        public void onGetRegisteredResult(DJIError error) {

          Log.d(TAG, error == null ? "success" : error.getDescription());
          if (error == DJISDKError.REGISTRATION_SUCCESS) {
            DJISDKManager.getInstance().startConnectionToProduct();
            Handler handler = new Handler(Looper.getMainLooper());
            handler.post(
                new Runnable() {

                  @Override
                  public void run() {
                    Toast.makeText(getApplicationContext(), "Success", Toast.LENGTH_LONG).show();
                  }
                });
            Log.d(TAG, "Register success");

          } else {
            Handler handler = new Handler(Looper.getMainLooper());
            handler.post(
                new Runnable() {

                  @Override
                  public void run() {
                    Toast.makeText(
                            getApplicationContext(),
                            "register sdk fails, check network is available",
                            Toast.LENGTH_LONG)
                        .show();
                  }
                });

            Log.d(TAG, "Register failed");
          }
          Log.e(TAG, error == null ? "success" : error.getDescription());
        }
 public static synchronized DJIBaseProduct getProductInstance() {
   if (null == mProduct) {
     mProduct = DJISDKManager.getInstance().getDJIProduct();
   }
   return mProduct;
 }