List of usage examples for android.content ContextWrapper getSharedPreferences
@Override public SharedPreferences getSharedPreferences(File file, int mode)
From source file:jp.mixi.android.sdk.MixiContainerImpl.java
/** * ?// w w w . j ava 2s .com * * @param contextWrapper ?activity * @param listener ???????????????(?????????) * @return ???????true * @throws RemoteException */ boolean restoreSession(final ContextWrapper contextWrapper) { new Thread(new Runnable() { @Override public void run() { SharedPreferences prefs = contextWrapper.getSharedPreferences(MIXI_SESSION_KEY, Context.MODE_PRIVATE); String appId = prefs.getString(CLIENT_ID, null); if (appId == null) { return; } setAccessToken(prefs.getString(ACCESS_TOKEN, null)); setRefreshToken(prefs.getString(REFRESH_TOKEN, null)); setAccessExpiresIn(prefs.getLong(EXPIRES, 0)); if (isAuthorized()) { runAppCounter(); } } }).start(); if (getAccessToken() == null) { return false; } return true; }