여기 내 코드 & probelm입니다.ProgressDailog가 표시되지 않는 이유는 무엇입니까?
static Throwable t= null;
static String responseFromServer = "";
static Activity a ;
static Handler mHandler = new Handler();
public static String sendToServer(final Activity act, final String data)
{
progDailog = ProgressDialog.show(act, "", " Please wait...", true);
progDailog.setCancelable(true); //BUT this not displaying
Thread th = new Thread()
{
public void run(){
try{
// .........code ... SENDING data to server
responseFromServer = httpclient.execute(httppost, new BasicResponseHandler()).trim();
mHandler.post(showResponse);
}
catch (Exception e)
{
t = e;
e.printStackTrace();
progDailog.dismiss();
mHandler.post(exception);
}
}
};
th.start();
th.join();
return responseFromServer;
}
private static Runnable showResponse = new Runnable()
{
public void run(){
Toast.makeText(a, responseFromServer, Toast.LENGTH_SHORT).show();
progDailog.dismiss();
}
};
private static Runnable exception = new Runnable()
{
public void run(){
Toast.makeText(a, t + " ", Toast.LENGTH_SHORT).show();
progDailog.dismiss();
}
};
왜 진행 대화 상자가 표시되지 않습니까? 그리고 정확한 위치는 어디에 있습니까?
와 함께. 고마워. – Santhosh
당신을 환영합니다. 항상 기꺼이 도와주세요. –