我想顯示一個ProgressDialog時按下我的列表視圖中的任何項目,而Detail類在背景中轉動,我知道我必須使用asyncTask,但我無法弄清楚如何,任何人都可以幫助我請?ProgressDialog Android AsyncTAsk
這是我的片段在那裏我去顯示ProgressDialog
public class FeedPlayerIndexFragment extends SherlockFragment{
String url="http://www.toto.com/index.php?format=feed&type=rss";
ArrayList<Article> feeds ;
AndroidSaxFeedParser feedParser= new AndroidSaxFeedParser(url);
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// TODO Auto-generated method stub
feeds=feedParser.parse();
View view=inflater.inflate(R.layout.main, container, false);
CustomItemAdapter_News lfa = new CustomItemAdapter_News(getActivity().getApplicationContext(), feeds);
((ListView)view.findViewById(R.id.listFeed)).setAdapter(lfa);
((ListView)view.findViewById(R.id.listFeed)).setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> arg0, View v, int position,long id) {
Bundle b = new Bundle();
b.putInt("position", position);
b.putString("url", url);
Intent intent=new Intent(getActivity().getApplicationContext(), DetailActivity.class);
intent.putExtras(b);
startActivity(intent);
}
});
return view;
}
}
這是我的詳細活動嘩嘩應該打開後臺
public class DetailActivity extends Activity{
String descriptionFinale = null,imageFinale = null,url;
int position;
TextView description_,titre,date;
ImageView image_;
ArrayList<Article> feeds ;
WebView contentWebView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.detail);
Bundle b = getIntent().getExtras();
position=b.getInt("position");
url=b.getString("url");
AndroidSaxFeedParser feedParser= new AndroidSaxFeedParser(url);
feeds=feedParser.parse();
date=(TextView) findViewById(R.id.date);
contentWebView= (WebView)findViewById(R.id.contentWebView);
titre=(TextView) findViewById(R.id.titre);
date.setText(feeds.get(position).getTitle());
GetDescriptionWebView.getDescriptionImage(position, feeds,contentWebView);
titre.setText("Postulé le: "+GetDateFormat.getDate(position, feeds));
}
}
具有u解決您的問題或需要解決的幫助??? –
我需要幫助:(( –
你想在你的DetailActivity類中獲得進度對話框??? –