I am adding views dynamically to linear layout in a for loop of more than 100 loops.
Now what I want to show ProgressDialog
while adding views. I added progressdialogue but it dismisses before views actually appear on the screen.
Is there any callback for views visible on screen
Here is my code
final ProgressDialog pd = new ProgressDialog(this);
pd.setMessage("Please wait...");
pd.setCancelable(false);
pd.show();
for (int i = 0; i < rowItemsListTemp.size(); i++) {
View view;
LayoutInflater inflater = (LayoutInflater) getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
view = inflater.inflate(R.layout.product_item_card, null);
txt_pro_name = (TextView) view.findViewById(R.id.txt_pro_name);
txt_pro_desc = (TextView) view.findViewById(R.id.txt_pro_desc);
txt_pro_name.setText(rowItemsListTemp.get(i).getProName());
txt_pro_desc.setText(Html.fromHtml(rowItemsListTemp.get(i).getProDesc()));
ll_batcheslist.addView(view);
}
if (pd.isShowing()) {
pd.dismiss();
}