2012-03-24 4 views
1

私のprogbarを終了し、私が望むように変更するには問題があります。 私のコードは、それを行うためにasytaskを使用しています。 コードは次のとおりです。progDailogバーで表示を変更しているときにエラーが発生しました

private class GetDataTask extends AsyncTask<Void, Void, Integer> { 
    private ProgressDialog Dialog = new ProgressDialog(rusNewsActivite.this); 
    protected void onPreExecute() { 
    Dialog.setMessage("Doing something..."); 
     Dialog.show(); 

    } 

問題はここから:

protected void onPostExecute(Integer result) { 
if(progDailog!=null) 
       progDailog.dismiss(); 

     setContentView(R.layout.main); 

     list = (ListView) findViewById(R.id.list); 
     adapter = new LazyAdapter((Activity) mContext, nrgList, imgList); 

     list.setAdapter(adapter); 
     adapter.notifyDataSetChanged(); 

はまだ彼らと私は助け

ため

adapter.notifyDataSetChanged(); 

感謝をした視聴項目の後にproBarを解任カント

答えて

0

if(progDailog!=null) 
progDailog.dismiss(); 

、あなたが<activity>タグに

android:configChanges="keyboardHidden|orientation|navigation" 
+0

OKNが、私は、画面上の項目の私のリストを取得した後、私はまだproBarを見ている私の問題をマニフェストにこの行を追加します。どのように私はそれを却下することができます。 adapter.notifyDataSetChanged(); コードに助けがありません –

+1

あなたは 'Dialog'を表示していて、' progDailog'を解除していますか?表示しているダイアログを閉じる必要があります。 – Sunny

+0

adapter.notifyDataSetChanged();あなたのリストを更新するダイアログを閉じません。 – Sunny

関連する問題