I read a lot about this and do not see anyone who would have done this or tried it before.
So, I have an object that extends ImageView, and then in it I call up the progress dialog and set the contents of the progress dialog to the image (i.e. I'm trying to draw a run dialog in the image view.).
loadingProgressDialog.setContentView(this); //this is: LoaderImageView extends ImageView loadingProgressDialog.setIndeterminate(true); loadingProgressDialog.show();
And I get the error: requestFeature () needs to be called before adding content
Now I have seen this error before on message loads, and yes the answer seems obvious. I tried to install all the functions:
loadingProgressDialog.requestWindowFeature(Window.FEATURE_NO_TITLE); loadingProgressDialog.requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); loadingProgressDialog.getWindow().requestFeature(Window.FEATURE_PROGRESS); loadingProgressDialog.getWindow().requestFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
But at first I donβt understand why I need this? And secondly, none of them work!
So the question is, can I set the ContentView for WindowView in ImageView? If so, what did I get wrong?
android imageview progressdialog custom-view
Blundell
source share