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
Create a handler object and execute all your Toast messages using that.
@Override
protected Void doInBackground(Void... params) {
Handler handler=new handler();
handler= new Handler(context.getMainLooper());
handler.post( new Runnable(){
public void run(){
Toast.makeText(context, "Created a server socket",Toast.LENGTH_LONG).show();
}
});
}