I have four methods, which have to execute one after another. So It means, second method have to wait until first method executes fully.
In my case I have methods inside my IfElse statements Like below. They are executing like second method is executing after some part execution in first method. Its like Asynchronous way.
if(flag.equalsIgnoreCase("flag2"))
{method1();
}else if(flag.equalsIgnoreCase("flag3")){
method2();
}else if(flag.equalsIgnoreCase("flag4"))
{ method3();
}
setCommonData();
setRecyclerAdapter();
and below is my method implementation after adding synchronization keyword.
 synchronized void method1()
    {
    Log.e("filter","======");
    Class 1 class1=new Class1(this,GET,response->{
    Log.e("response",""===success====);
    });
NetworkManager.getInstance(this).sendRequest(class1);
    }
Remaining methods are same as method 1 implementation.
I have used AsyncTasks Also by calling two methods inside onBackground and onPostExecute.
I have used Threads with t.start() and t.join();. But same those calling Asynchronously.
In my case I need to execute these methods one by one. Please some help me on this issue.
 
     
     
    