은 내가 어떤 메시지를 표시해야하는 웹 서비스 호출 응답에 근거하여 비누 웹 서비스 호출을 사용하고 자식 스레드에서는. 내 응용 프로그램에서
을 주요 THEAD의 메소드를 호출하지만 응답 후 나는 할 수 없었다 메인 스레드 다시 연락이 분명하다
희망을 가지고 내가 응답 한 후이 표시 .. 내 요구 사항을 달성하는 방법을 도와하는 방법
그래서 양산 자식 스레드에서이 작업을 수행 할 수
{
Thread t1 = new Thread() {
public void run() {
String threadName = Thread.currentThread().getName();
// There will be delay in this statement while fetching a data from webservice
String returnfromWebservice = webservice(xmlDetails, "generateid");
Log.v("returnfromWebservice",returnfromWebservice);
if( ! returnfromWebservice.equalsIgnoreCase("nil")){
gotid = returnfromWebservice;
gotReply=true;
// dothis();// I could able to do this because this method contains widgets
// I am gettin the error : Only the original thread that created a view hierarchy can touch its views.
//I understand this is because childthread has no controls on widget
/**Suggest me how to get back to main thread*/
}
}};
t1.start();
dothis();// so i am doin here after the completion of it
}
public void dothis{
if(gotReply){
idtext.setText(gotid);
genId.setEnabled(false);
Toast.makeText(WelcomeScorer.this, "Generated ", 500).show();
}
else{
Toast.makeText(WelcomeScorer.this, "Try Once More ", 500).show();
idtext.setText(gotid);
}
}
나는 안드로이드에 익숙하지 만,이 상황을 처리하기위한 안드로이드 API에 대한 최선의 접근 방법이 있습니까 ??