當前位置: 首頁>>代碼示例>>Java>>正文


Java ParseUser.logOutInBackground方法代碼示例

本文整理匯總了Java中com.parse.ParseUser.logOutInBackground方法的典型用法代碼示例。如果您正苦於以下問題:Java ParseUser.logOutInBackground方法的具體用法?Java ParseUser.logOutInBackground怎麽用?Java ParseUser.logOutInBackground使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.parse.ParseUser的用法示例。


在下文中一共展示了ParseUser.logOutInBackground方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: logout

import com.parse.ParseUser; //導入方法依賴的package包/類
public void logout() {
    if (mMockParse != null) {
        mMockParse.setIsLoggedIn(false);
        if (isInstrumentationTest()) {
            LocationTrackingService.stop();
            EventBus.getDefault()
                    .post(new LogoutEvent(null));
        }
    } else {
        ParseUser.logOutInBackground(new LogOutCallback() {
            @Override
            public void done(ParseException e) {
                if (e != null) {
                    EventBus.getDefault()
                            .post(new LogoutEvent(e));
                } else {
                    LocationTrackingService.stop();
                    EventBus.getDefault()
                            .post(new LogoutEvent(null));
                }
            }
        });
    }
}
 
開發者ID:ralphpina,項目名稱:ActivityMapper,代碼行數:25,代碼來源:Account.java

示例2: actuallyLogout

import com.parse.ParseUser; //導入方法依賴的package包/類
private void actuallyLogout() {
    final ProgressDialog pd = new ProgressDialog(getContext());
    pd.setMessage(getContext().getString(R.string.performingLogout));
    pd.setCancelable(false);
    pd.show();

    ParseUser.logOutInBackground(new LogOutCallback() {
        @Override
        public void done(ParseException e) {
            pd.dismiss();
            pd.cancel();
            if(e != null) {
                Toast.makeText(getContext(), getContext().getString(R.string.performedLogoutError), Toast.LENGTH_LONG).show();
            } else {
                Toast.makeText(getContext(), getContext().getString(R.string.performedLogoutSuccess), Toast.LENGTH_SHORT).show();
                LoginManager.getInstance().logout();
                ((MainActivity) getActivity()).updateDrawer();
                ((MainActivity)getActivity()).openDrawer();
                ((MainActivity)getActivity()).setupEventFragment();
            }
        }
    });
}
 
開發者ID:LibertACAO,項目名稱:libertacao-android,代碼行數:24,代碼來源:PerfilFragment.java

示例3: onSnackListUpdateComplete

import com.parse.ParseUser; //導入方法依賴的package包/類
@Override
public void onSnackListUpdateComplete(ParseException e) {
    // Start the login activity if the session token is invalid.
    if(e != null && e.getCode() == ParseException.INVALID_SESSION_TOKEN){
        if(myActivity != null){
            Intent startLoginIntent = new Intent(myActivity, LoginActivity.class);
            ParseUser.logOutInBackground();
            myActivity.finish();
            startActivity(startLoginIntent);
        }
    }

    adapter.notifyDataSetChanged();

    if(progressOverlay != null){
        progressOverlay.setVisibility(View.GONE);
    }

    // Show the help message if appropriate.
    // That is, if we haven't already showed it for the current user this session and the
    // current user has zero entries. Only show the help message if the SnackList is pointing
    // at the current user.
    if(lastShowedHelpFor != ParseUser.getCurrentUser()
            && !showingHelp && SnackList.getInstance().size() == 0
            && ParseUser.getCurrentUser().equals(SnackList.getInstance().getUser())){
        try{
            showHelpMessage();
        } catch(IllegalStateException ignored){
            // In the case that onSaveInstanceState has been already been called, we ignore
            // the exception.
        }
    }
}
 
開發者ID:SCCapstone,項目名稱:diet,代碼行數:34,代碼來源:PreviousEntriesFragment.java

示例4: onOptionsItemSelected

import com.parse.ParseUser; //導入方法依賴的package包/類
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    // Handle action bar item clicks here. The action bar will
    // automatically handle clicks on the Home/Up button, so long
    // as you specify a parent activity in AndroidManifest.xml.
    int id = item.getItemId();

    //noinspection SimplifiableIfStatement
    if (id == R.id.action_signout) {
        ParseUser.logOutInBackground(new LogOutCallback() {
            @Override
            public void done(ParseException e) {
                if(e == null){
                    Intent i = new Intent(getApplicationContext(), SignOnActivity.class);
                    startActivity(i);
                    finish();
                }
                else{
                    //couldn't log out
                    e.printStackTrace();
                }
            }
        });
        return true;
    }

    return super.onOptionsItemSelected(item);
}
 
開發者ID:teamOSC,項目名稱:Studddinv2_android,代碼行數:29,代碼來源:MainActivity.java

示例5: logout

import com.parse.ParseUser; //導入方法依賴的package包/類
/**
 * Logs out the current user and starts the new account activity.
 * Just starts the new account activity is no user is logged in
 */
private void logout(){
    ParseUser.logOutInBackground(new LogOutCallback() {

        @Override
        public void done(ParseException e) {
            if(e == null){
                startLoginActivity();
            } else{
                updateToast(e.getMessage(), Toast.LENGTH_LONG);
            }
        }
    });
}
 
開發者ID:SCCapstone,項目名稱:diet,代碼行數:18,代碼來源:MainActivity.java

示例6: executeLogout

import com.parse.ParseUser; //導入方法依賴的package包/類
public void executeLogout(){
	ParseUser.logOutInBackground();
	clearLogin();
}
 
開發者ID:rockgecko-development,項目名稱:connectedteam-android,代碼行數:5,代碼來源:Session.java


注:本文中的com.parse.ParseUser.logOutInBackground方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。