package com.fwpt.activity; import com.fwpt.entity.RyUserInfo;import com.fwpt.entity.SmlaUserinfo;import com.fwpt.utils.SpfsUtils;import com.fwpt.utils.StringUtils;import android.app.Activity;import android.content.Context;import android.os.Bundle;public class BaseActivity extends Activity { private Context objContext; @Override protected void onCreate(Bundle savedInstanceState) { // TODO 自动生成的方法存根 super.onCreate(savedInstanceState); this.objContext = this; } public SmlaUserinfo GetUserinfo() { SmlaUserinfo userinfo = SpfsUtils.getUserInfo(objContext); if (userinfo == null) { userinfo=new SmlaUserinfo(); userinfo.setUserinfoid(1); userinfo.setNickname(""); userinfo.setUserid(0); userinfo.setSex(0); userinfo.setBirthday(StringUtils.getTimestampToDate("")); userinfo.setFace(""); } return userinfo; } /** * 验证登录状态 */ public boolean InitSessionVerify() { SmlaUserinfo userinfo = SpfsUtils.getUserInfo(objContext); if(userinfo==null){ return true; } if(StringUtils.isEmpty(userinfo.getUserid()+"")) { return true; } return false; } /** * 验证融云IM是否启动 * @return */ public boolean InitChatVerify(){ RyUserInfo ryUserInfo=SpfsUtils.getRyInfo(objContext); if(ryUserInfo!=null && StringUtils.isEmpty(ryUserInfo.getUserid())){ return true; } return false; }}