In my application, in MainActivity, there is a thread which works fine. But when I call another class to get data from the server I can\'t run on a thread. See code exampl
Here's a solution if you don't want to pass the context:
new Handler(Looper.getMainLooper()).post(new Runnable() { public void run() { // code goes here } });