Back to project page wizapp.
The source code is released under:
MIT License
If you think the Android project wizapp listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.wb.wizapp.concurret; /* w w w. j av a 2s . co m*/ import java.lang.ref.WeakReference; import android.os.AsyncTask; import com.wb.wizapp.ui.BaseActivity; public abstract class UISyncTask<PR, PG, RS> extends AsyncTask<PR, PG, RS> { protected final WeakReference<BaseActivity> wkAct; public UISyncTask(BaseActivity act) { this.wkAct = new WeakReference<BaseActivity>(act); } @Override protected void onPreExecute() { super.onPreExecute(); BaseActivity act = wkAct.get(); if (act != null) { act.ShowProgress(); } } @Override protected void onPostExecute(RS result) { super.onPostExecute(result); BaseActivity act = wkAct.get(); if (act != null) { act.HideProgress(); } } }