【发布时间】:2017-01-23 13:57:25
【问题描述】:
我有一个应用程序,它从 json 获取数据并将其显示在回收站视图中 并且当单击每个回收器视图时,它会打开一个新活动以显示完整内容。我只想知道如何在第二个活动显示感谢之前显示进度对话框。 这是我的代码
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
标签: android json android-recyclerview progressdialog