清理缓存加载loading,如何正确显示代码实现

//清除缓存带加载框 private void clearnAllCache(Context mContext) { showProgressDialog(mContext, false, "清理缓存"); try { String data = https://www.it610.com/article/DataCleanManager.getTotalCacheSize(mContext); new Thread(new Runnable() { @Override public void run() { DataCleanManager.cleanApplicationData(mContext); DataCleanManager.clearAllCache(mContext); runOnUiThread(new Runnable() { @Override public voidrun() { if (!isFinishing()) { Message message = handler.obtainMessage(); message.obj = data; handler.sendMessageDelayed(message, 300); } } }); } }).start(); } catch (Exception ex) { } } Handler handler = new Handler() { @Override public void handleMessage(Message msg) { super.handleMessage(msg); hideProgressDialog(); ToastUtils.showShort(MineSettingActivity.this,msg.obj.toString()); } }; }

调用clearnAllCache(context)方法即可 【清理缓存加载loading,如何正确显示代码实现】

    推荐阅读