how to run a task on ui thread. I am trying to run a task on ui thread
  MainActivity.this.runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    Toast.makeText(MainActivity.this, 
                        "Mytask finished", 
                        Toast.LENGTH_SHORT).show();
                }
            });
 
    