You need your Activity object to do this. Pass your Activity's this reference through the constructor and use it in your AsyncTask.
public class AdamTask extends AsyncTask{
public void showToast(final String toast)
{
activityObj.runOnUiThread(new Runnable() {
public void run()
{
Toast.makeText(context, toast, Toast.LENGTH_SHORT).show();
}
});
}
}
Since runOnUiThread is a public method in Activity class, you cannot use it in some other Custom class or class that extends other than Activity itself.
Look here, runonUi.
If you are not clear, please check this answer to learn how to send Activity Object through constructor