I want to Update the Progress bar in my application.
I have created a new view by making use of inflater and in that newly created view I want to show the Horizontal Progress Bar Updating.
How can I do that particularly?
Also I got to know that when We create a new view by Inflater, we need to add it to the Current Activity Class by addContentView(), I don’t know how to do these though I have tried a lot till now.
Can anybody help me here?
So, as you don’t provide code, let me search my crystal ball… wait… OK, there it is. You have something like this:
In order to access your
ProgressBar, you have to use thefindViewByIdmethod:In order to add the view that contains the progress bar to you current activity, you have to have a reference to the container that you previously set. So, I guess you previously did:
setContentView(R.layout.something);, then you have a layout calledsomething.xml; that layout contains aViewGroup(LinearLayout,RelativeLayout, etc.; my crystal ball can’t see that clearly). Then, you need to set an ID to that container, create a reference, and add your newly created view to it: