Java 类com.android.volley.toolbox.ClearCacheRequest 实例源码
项目:FMTech
文件:FinskyApp.java
public final void clearCacheAsync(final Runnable paramRunnable)
{
Runnable local11 = new Runnable()
{
private int mClearedCount = 0;
public final void run()
{
this.mClearedCount = (1 + this.mClearedCount);
if ((this.mClearedCount == 2) && (paramRunnable != null)) {
paramRunnable.run();
}
}
};
this.mRequestQueue.add(new ClearCacheRequest(this.mCache, local11));
this.mBitmapRequestQueue.add(new ClearCacheRequest(this.mBitmapCache, local11));
}
项目:FMTech
文件:FinskyApp.java
public final void clearRequestCacheAsync(Runnable paramRunnable)
{
this.mRequestQueue.add(new ClearCacheRequest(this.mCache, paramRunnable));
}
项目:barterli_android
文件:AbstractBarterLiActivity.java
/**
* Disconnects the chat service, clears any local data
*/
public void logout() {
if (isLoggedIn()) {
//TODO: Vinay - Add Dialog about chat messages being lost
final RequestQueue requestQueue = ((BarterLiApplication) getApplication())
.getRequestQueue();
requestQueue.add(new ClearCacheRequest(requestQueue.getCache(), new Runnable() {
@Override
public void run() {
UserInfo.INSTANCE.reset();
DBInterface.deleteAsync(QueryTokens.DELETE_CHATS, getTaskTag(), null,
TableChats.NAME, null, null, true,
AbstractBarterLiActivity.this);
DBInterface.deleteAsync(QueryTokens.DELETE_CHAT_MESSAGES, getTaskTag(), null,
TableChatMessages.NAME, null, null, true,
AbstractBarterLiActivity.this);
SharedPreferenceHelper
.removeKeys(AbstractBarterLiActivity.this, R.string.pref_auth_token,
R.string.pref_email, R.string.pref_description,
R.string.pref_location, R.string.pref_first_name,
R.string.pref_last_name, R.string.pref_user_id,
R.string.pref_profile_image, R.string.pref_share_token,
R.string.pref_referrer, R.string.pref_referrer_count);
final Intent disconnectChatIntent = new Intent(AbstractBarterLiActivity.this,
ChatService.class);
disconnectChatIntent.setAction(AppConstants.ACTION_DISCONNECT_CHAT);
startService(disconnectChatIntent);
LocalBroadcastManager.getInstance(BarterLiApplication.getStaticContext())
.sendBroadcast(
new Intent(AppConstants.ACTION_USER_INFO_UPDATED));
final Intent homeIntent = new Intent(AbstractBarterLiActivity.this,
HomeActivity.class);
homeIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(homeIntent);
}
}));
}
}