Try Async Task or for your part of code.
“AbstractQueuedSynchronizer”
looks Synchronizing problem.
public class Task extends AsyncTask<Void, Void, Void>
{
@Override
protected void onPreExecute() {
super.onPreExecute();
}
protected Void doInBackground(Void... paths) {
//here your code (approx from line 400 to 850)
return null;
}
@Override
protected void onPostExecute(Void result) {
super.onPostExecute(result);
}
}
for call Task on button click or from any other method
new Task().execute();