0

読み込み中のテキストのみを表示しようとしています。問題は、ロードが完了したら、それを目に見えるように設定し、すぐに目に見えないように設定することです。しかし、テキストが更新される機会は決してありません。画面を強制的に更新する方法はありますか、それとも別の方法がありますか? ありがとう

これは私のコードです

SearchBtn = (Button) findViewById(R.id.SearchButton);

  SearchBtn.setOnClickListener(new OnClickListener() 
  {
     public void onClick(View arg0) 
     {
       //this is never seen because its set straight after to invisible
       LoadingText.setVisibility(View.VISIBLE); 

       SearchFor(EditSearchField.getText().toString()); // all loading done here

       LoadingText.setVisibility(View.INVISIBLE); 

       HideKeyboard();

   }
   });
4

1 に答える 1

2

実際のロードは別のスレッドで行う必要があります。これには AsyncTask を使用することをお勧めします。http://www.vogella.com/articles/AndroidPerformance/article.htmlをご覧ください。

于 2012-12-22T00:40:53.313 に答える