public void run() { Manager manager = Manager.getInstance(); if (manager.getFormatFile() == 1) { // if file format =1, start XML Parser xmlFile.downloadFile(); synchronized (xmlParseThread) { xmlParseThread.notify(); } } if (manager.getFormatFile() == 2) { // if file format = 2, start JSON Parser jsonFile.downloadFile(); synchronized (jsonParseThread) { jsonParseThread.notify(); } } }