서버에서 정보를 읽어올때 느리길래 로딩중 표시화면을 달려고 하는데 계속 안되네요.(ㅠㅠ)
따로 클래스파일로 만들어서 필요할때마다 로딩중 표시를 할려고 아래처럼 했는데... 저 로딩중 화면클래스를
못 불러오는것 같습니다. 왜 그럴까요??? 어디가 틀려서 아래처럼 하면 안되는 것인가요???
[sendHTTP.java] //서버와 통신 모듈
...
import com.bbb.myProgect.dialog.* //이렇게 하면 dialog.java클래스를 불러오는거 맞는지요?
...
public Activity act; //액티비티 구분용 변수
...
public String sendPost( ) {
String result = null;
if(act != null) { ((dialog)act.getApplication()).startLoading(act); } //로딩중 화면표시 시작
result = sendPostMain( ); //서버와 실제통신 부분
if(act != null) { ((dialog)act.getApplication()).endLoading(); } //로딩중 화면표시 중지
return result;
}
------------------------------------------------------------------------------------------
[dialog.java] //로딩중 화면표시 모듈
...
public class dialog extends Application {
public ProgressDialog loadingDialog;
public void startLoading(Context ctx) {
loadingDialog = ProgressDialog.show(ctx, "로딩중...", "Please wait...", true, false);
}
public void endLoading() {
endLoader endLoader = new endLoader();
Timer timer = new Timer(false);
timer.schedule(endLoader, 1000); //1초후에 endLoader 실행
}
class endLoader extends TimerTask {
endLoader() {}
public void run() {
loadingDialog.dismiss();
}
}
}




(자답 입니다...)
아무래도 저렇게는 로딩중 표시되는 부분을 불러들이지 못하는 것 같아서,
dialog new_dialog = new dialog();
dialog.startLoading(act); //로딩중 표시 시작
dialog.endLoading(); //로딩중 표시 종료
이렇게 하니까 되네요.