時,我有一個應用程序從JSON獲取數據並顯示在回收視圖 ,當單擊各個回收視圖它會打開一個新的活動,以顯示全部內容。所有我想知道的是如何顯示進度對話框befrore第二項活動顯示的感謝。 這裏是我的代碼如何設置進度條回收視圖點擊
public CustomViewHolder(View view, Context ctx, ArrayList<FeedItem> feeditem) {
super(view);
view.setOnClickListener(this);
this.ctx = ctx;
this.feeditem = feeditem;
this.imageView = (ImageView) view.findViewById(R.id.thumbnail);
this.textView2 = (TextView) view.findViewById(R.id.date);
this.textView3 = (TextView) view.findViewById(R.id.excerpt);
this.categories = (TextView) view.findViewById(R.id.categories);
this.textView = (TextView) view.findViewById(R.id.title);
}
@Override
public void onClick(View v) {
int position = getAdapterPosition();
FeedItem feeditem = this.feeditem.get(position);
Intent intent = new Intent(this.ctx, ScrollingActivity.class);
intent.putExtra("excerpt",feeditem.getExcerpt());
intent.putExtra("content",feeditem.getContent());
intent.putExtra("title",feeditem.getTitle());
Html.fromHtml(String.valueOf(intent.putExtra("content",feeditem.getContent()))).toString();
intent.putExtra("thumbnail",feeditem.getAttachmentUrl());
this.ctx.startActivity(intent);
}
在顯示其他活動之前是否有延遲?爲什麼你想要顯示進度對話框? –
是有延遲;圖像需要時間,所以因此我希望進度對話框顯示爲圖像渲染@AbhishekJain –