本文整理汇总了Java中com.avos.avoscloud.AVUser.logOut方法的典型用法代码示例。如果您正苦于以下问题:Java AVUser.logOut方法的具体用法?Java AVUser.logOut怎么用?Java AVUser.logOut使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.avos.avoscloud.AVUser
的用法示例。
在下文中一共展示了AVUser.logOut方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onClick
import com.avos.avoscloud.AVUser; //导入方法依赖的package包/类
@Override
public void onClick(View v) {
int id = v.getId();
if (id == R.id.avatarLayout) {
Intent intent = new Intent(Intent.ACTION_PICK, null);
intent.setDataAndType(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
"image/*");
startActivityForResult(intent, IMAGE_PICK_REQUEST);
} else if (id == R.id.logout) {
ChatService.closeSession();
AVUser.logOut();
getActivity().finish();
} else if (id == R.id.sexLayout) {
showSexChooseDialog();
}
}
示例2: onOptionsItemSelected
import com.avos.avoscloud.AVUser; //导入方法依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.menu_filter:
drawer.openDrawer(GravityCompat.END);
return true;
case R.id.menu_search:
// get the icon's location on screen to pass through to the search screen
View searchMenuView = toolbar.findViewById(R.id.menu_search);
int[] loc = new int[2];
searchMenuView.getLocationOnScreen(loc);
startActivityForResult(SearchActivity.createStartIntent(this, loc[0], loc[0] +
(searchMenuView.getWidth() / 2)), RC_SEARCH, ActivityOptions
.makeSceneTransitionAnimation(this).toBundle());
searchMenuView.setAlpha(0f);
return true;
case R.id.menu_designer_news_login:
if (!designerNewsPrefs.isLoggedIn()) {
startActivity(new Intent(this, DesignerNewsLogin.class));
} else {
AVUser.logOut();
Toast.makeText(getApplicationContext(), R.string.designer_news_logged_out,
Toast.LENGTH_SHORT).show();
}
return true;
case R.id.menu_add:
startActivity(new Intent(HomeActivity.this, AddActivity.class),
ActivityOptions.makeSceneTransitionAnimation(this).toBundle());
return true;
case R.id.menu_about:
startActivity(new Intent(HomeActivity.this, AboutActivity.class),
ActivityOptions.makeSceneTransitionAnimation(this).toBundle());
return true;
}
return super.onOptionsItemSelected(item);
}
示例3: logout
import com.avos.avoscloud.AVUser; //导入方法依赖的package包/类
public void logout(){
AVUser.logOut();
}