How would I use a Looper with an asyncTask?
The doImBackground method is called to programmatically create a TableLayout called MyResultTable. The MyResultTable, in turn, has a handler that is called by onTouch during MotionEvent.ACTION_MOVE
.
After getting complaints about using handle inside asynchTask, I decide to run handler on UIThread. But that's causing my onTouch method to have slow response. So my question is, how do I use a looper with an asyncTask?
UIThread code:
activity.runOnUiThread(new Runnable() {
public void run() {
handler.post(mResizeViews);
}
});
My Looper attempt: (not working: blank screen)
protected MyResultTable doInBackground(Void... params) {
Looper.prepare();
MyResultTable table = new MyResultTable(context, other);
Looper.loop();
return tabl;
}