예제 #1
0
  public static void snagLogin(boolean isSubTask) {
    Log.i(TAG, "Inside the snagLogin...");
    // save the details for single sign-on
    LoginUtil.saveLoginDetailsInSharedPref(mUserInfo, mContext);

    if (mLoginProgressDialog.isShowing()) {
      // mLoginProgressDialog.dismiss();
    }
    try {
      if (isSubTask) {
        Looper.prepare();
      }
      loginHandler.saveUser(mUserInfo);
      if (mLoginProgressDialog != null && !mLoginProgressDialog.isShowing()) {
        Log.i(TAG, "after snaglogin calling");
        mLoginProgressDialog.setMessage("Login in progress...");
        mLoginProgressDialog.show();
      }
    } catch (SaveUserException e) {
      if (mLoginProgressDialog.isShowing()) {
        mLoginProgressDialog.dismiss();
      }
      Log.e(TAG, e.getMessage());

      Toast.makeText(mContext, e.getMessage(), Toast.LENGTH_LONG).show();
    }
  }
예제 #2
0
  public TwitterUtil(Context mContext, String source, String filmId, boolean fromQueue) {
    TwitterUtil.mContext = mContext;
    mLoginProgressDialog = new ProgressDialog(mContext);
    mLoginProgressDialog.setCanceledOnTouchOutside(false);
    twitterHandler = new TwitterUsr(mContext);
    twitterHandler.setListener(this);

    loginHandler = new SaveUserHandler(mContext);
    loginHandler.setListener(this);
    this.source = source;
    this.mFilmId = filmId;
    this.fromQueue = fromQueue;
    context = (Activity) mContext;
  }