Java Code Examples for com.facebook.react.bridge.GuardedResultAsyncTask

The following are top voted examples for showing how to use com.facebook.react.bridge.GuardedResultAsyncTask. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: RNLearn_Project1   File: ForwardingCookieHandler.java   View source code 6 votes vote down vote up
public void clearCookies(final Callback callback) {
  if (USES_LEGACY_STORE) {
    new GuardedResultAsyncTask<Boolean>(mContext) {
      @Override
      protected Boolean doInBackgroundGuarded() {
        getCookieManager().removeAllCookie();
        mCookieSaver.onCookiesModified();
        return true;
      }

      @Override
      protected void onPostExecuteGuarded(Boolean result) {
        callback.invoke(result);
      }
    }.execute();
  } else {
    clearCookiesAsync(callback);
  }
}
 
Example 2
Project: RNLearn_Project1   File: ForwardingCookieHandler.java   View source code 6 votes vote down vote up
public void clearCookies(final Callback callback) {
  if (USES_LEGACY_STORE) {
    new GuardedResultAsyncTask<Boolean>(mContext) {
      @Override
      protected Boolean doInBackgroundGuarded() {
        getCookieManager().removeAllCookie();
        mCookieSaver.onCookiesModified();
        return true;
      }

      @Override
      protected void onPostExecuteGuarded(Boolean result) {
        callback.invoke(result);
      }
    }.execute();
  } else {
    clearCookiesAsync(callback);
  }
}
 
Example 3
Project: ReactNativeSignatureExample   File: ForwardingCookieHandler.java   View source code 6 votes vote down vote up
public void clearCookies(final Callback callback) {
  if (USES_LEGACY_STORE) {
    new GuardedResultAsyncTask<Boolean>(mContext) {
      @Override
      protected Boolean doInBackgroundGuarded() {
        getCookieManager().removeAllCookie();
        mCookieSaver.onCookiesModified();
        return true;
      }

      @Override
      protected void onPostExecuteGuarded(Boolean result) {
        callback.invoke(result);
      }
    }.execute();
  } else {
    clearCookiesAsync(callback);
  }
}
 
Example 4
Project: react-native-ibeacon-android   File: ForwardingCookieHandler.java   View source code 6 votes vote down vote up
public void clearCookies(final Callback callback) {
  if (USES_LEGACY_STORE) {
    new GuardedResultAsyncTask<Boolean>(mContext) {
      @Override
      protected Boolean doInBackgroundGuarded() {
        getCookieManager().removeAllCookie();
        mCookieSaver.onCookiesModified();
        return true;
      }

      @Override
      protected void onPostExecuteGuarded(Boolean result) {
        callback.invoke(result);
      }
    }.execute();
  } else {
    clearCookiesAsync(callback);
  }
}
 
Example 5
Project: react-native-box-loaders   File: ForwardingCookieHandler.java   View source code 6 votes vote down vote up
public void clearCookies(final Callback callback) {
  if (USES_LEGACY_STORE) {
    new GuardedResultAsyncTask<Boolean>(mContext) {
      @Override
      protected Boolean doInBackgroundGuarded() {
        getCookieManager().removeAllCookie();
        mCookieSaver.onCookiesModified();
        return true;
      }

      @Override
      protected void onPostExecuteGuarded(Boolean result) {
        callback.invoke(result);
      }
    }.execute();
  } else {
    clearCookiesAsync(callback);
  }
}
 
Example 6
Project: Ironman   File: ForwardingCookieHandler.java   View source code 6 votes vote down vote up
public void clearCookies(final Callback callback) {
  if (USES_LEGACY_STORE) {
    new GuardedResultAsyncTask<Boolean>(mContext) {
      @Override
      protected Boolean doInBackgroundGuarded() {
        getCookieManager().removeAllCookie();
        mCookieSaver.onCookiesModified();
        return true;
      }

      @Override
      protected void onPostExecuteGuarded(Boolean result) {
        callback.invoke(result);
      }
    }.execute();
  } else {
    clearCookiesAsync(callback);
  }
}