Activitiy admin mainmenu(in application com.itwine)is not responding followed by two buttons 1.force close 2.wait
imgBtnSyncQues = (ImageButton) findViewById(R.id.imgBtnSyncQuestions);
imgBtnSyncQues.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
viewOrders = new Runnable(){
public void run() {
ftpQuesSync();
}
};
Thread thread = new Thread(null, viewOrders, "MagentoBackground");
thread.start();
m_ProgressDialog = ProgressDialog.show(AdminMainMenu.this,
"Please wait...", "Syncing Questions ...", true);
}
});
private void ftpQuesSync()
{
FTPClient ObjFtpCon = new FTPClient();
try
{
ObjFtpCon.connect(strIp);
if (ObjFtpCon.login(strFtpUser, strFtpPwd))
{
ObjFtpCon.enterLocalPassiveMode(); // important!
ObjFtpCon.cwd("/QIA/Questions/Hotel/");
String[] strArrQuesFiles=ObjFtpCon.listNames();
int intcnt=0;
boolean blnresult = false;
File objfile=new File(getFilesDir().getAbsolutePath()+ "/Questions");
if(!objfile.exists())objfile.mkdirs();
objfile=null;
for(intcnt=0;intcnt<strArrQuesFiles.length;intcnt++)
{
objfile=new File(getFilesDir().getAbsolutePath()+ File.separator + "/Questions/" + strArrQuesFiles[intcnt]);
objfile.createNewFile();
//ByteArrayInputStream in = new ByteArrayInputStream(data.getBytes());
FileOutputStream objFos=new FileOutputStream(objfile);
blnresult=ObjFtpCon.retrieveFile(strArrQuesFiles[intcnt] , objFos);
objFos.close();
}
ObjFtpCon.logout();
ObjFtpCon.disconnect();
if(blnresult) runOnUiThread(returnRes);return;
// boolean result = con.storeFile("/QIA/Response/test/Responses.xml", in);
}
}
catch (Exception e)
{
e.printStackTrace();
runOnUiThread(returnnone);
return;
}
runOnUiThread(returnnone);
}