0

私のリスト ビュー アイテムには 3 つまたは 4 つのボタンがあり、非同期タスクを使用して各ボタンで Web サービスを呼び出しています。 Web サービス呼び出し。

誰かがそれを行う方法を教えてもらえますか?

4

2 に答える 2

0

AsyncTask の onPostExecute() メソッドで、ボタンの setBacgroundColor() メソッドに変更を加えることができます。

@Override
protected void onPostExecute(String result) {
         super.onPostExecute(result);
             //Do what ever you want depending on the result that you 
             //you pass in the return of the doInBackGround....
             button.setBackGroundColor(Color.GREEN);
     }
于 2013-04-14T06:25:13.837 に答える
0

これを試してみてください

  1. クリックしたボタンの参照 (その onClickListener から取得したビュー) を実行しようとしている asyncTask に渡します。
  2. asyncTask を開始する
  3. Post execute で、ビューの背景を変更します。
于 2013-04-14T06:34:36.287 に答える