private void getAccountInfo() { SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this); String id = sharedPref.getString("id", ""); if (!TextUtils.isEmpty(id)) { accountBean = DatabaseManager.getInstance().getAccount(id); if (accountBean != null) { token = accountBean.getAccess_token(); getActionBar().setSubtitle(accountBean.getUsernick()); } else { List<AccountBean> accountList = DatabaseManager.getInstance().getAccountList(); if (accountList != null && accountList.size() > 0) { AccountBean account = accountList.get(0); accountBean = account; token = account.getAccess_token(); getActionBar().setSubtitle(account.getUsernick()); } } } }
private String getLastContent() { SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this); String draft = sharedPref.getString(TYPE_DRAFT, ""); return draft; }
private void savaDraft() { if (!TextUtils.isEmpty(content.getText().toString())) { SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this); sharedPref.edit().putString(TYPE_DRAFT, content.getText().toString()).commit(); } }