public static YiBoMe getYiBoMeOAuth(Context context) { if (context == null) { return null; } ConfigSystemDao configDao = new ConfigSystemDao(context); String authToken = configDao.getString(Constants.PASSPORT_TOKEN); String authSecret = configDao.getString(Constants.PASSPORT_SECRET); if (StringUtil.isEmpty(authToken) || StringUtil.isEmpty(authSecret)) { return null; } OAuthAuthorization auth = new OAuthAuthorization(authToken, authSecret, ServiceProvider.YiBoMe); return new YiBoMeImpl(auth); }
@Override public void afterTextChanged(Editable s) { String filterName = s.toString(); if (StringUtil.isEmpty(filterName)) { filterName = " "; } usersAdapter.getFilter().filter(filterName); usersAdapter.notifyDataSetChanged(); }
@Override public void afterTextChanged(Editable s) { if (StringUtil.isEmpty(etScreenName.getText().toString())) { btnProfileUpdate.setEnabled(false); } else if (StringUtil.isEquals(user.getScreenName(), etScreenName.getText().toString()) && StringUtil.isEquals(user.getDescription(), etDescription.getText().toString())) { btnProfileUpdate.setEnabled(false); } else { btnProfileUpdate.setEnabled(true); } }
protected Context getPackageContext(Context context, String packageName) { Context packageContext = null; if (StringUtil.isEmpty(packageName)) { return packageContext; } try { packageContext = context.createPackageContext(packageName, Context.CONTEXT_IGNORE_SECURITY); } catch (NameNotFoundException e) { if (Constants.DEBUG) Log.e(TAG, e.getMessage(), e); } return packageContext; }