In one of my activities I\'m using AsyncTask. In doInBackground() I\'m making calls to various methods. In one of these methods I\'m getting an exc
Write the following code where you have to show toast in doInBackground() method
runOnUiThread(new Runnable() {
public void run() {
Toast.makeText(getApplicationContext(), "Example for Toast", Toast.LENGTH_SHORT).show();
}
});
Fragments, you need to call runOnUiThread(...) through your activity:getActivity().runOnUiThread(...)