package com.tencent.hq.qq.ui; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.WindowManager; import android.view.inputmethod.InputMethodManager; import cn.bmob.im.BmobUserManager; public class ActivityBase extends BaseActivity { @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); checkLogin(); } @Override protected void onResume() { // TODO Auto-generated method stub super.onResume(); //����״̬�µļ�� checkLogin(); } public void checkLogin() { BmobUserManager userManager = BmobUserManager.getInstance(this); if (userManager.getCurrentUser() == null) { ShowToast("您的账号已在其他设备上登陆!"); startActivity(new Intent(this, LoginActivity.class)); finish(); } } /** ��������� * hideSoftInputView * @Title: hideSoftInputView * @Description: TODO * @param * @return void * @throws */ public void hideSoftInputView() { InputMethodManager manager = ((InputMethodManager) this.getSystemService(Activity.INPUT_METHOD_SERVICE)); if (getWindow().getAttributes().softInputMode != WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN) { if (getCurrentFocus() != null) manager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); } } }