android - Updating the Progress Bar achieved in the New View -


i want update progress bar in application.

i have created new view making use of inflater , in newly created view want show horizontal progress bar updating.

how can particularly?

also got know when create new view inflater, need add current activity class addcontentview(), don't know how these though have tried lot till now.

can me here?

so, don't provide code, let me search crystal ball... wait... ok, there is. have this:

view someview = inflater.inflate(r.layout.view_with_progress_bar, null); 

in order access progressbar, have use findviewbyid method:

progressbar yourprogressbar = (progressbar)someview.findviewbyid(r.id.id_of_your_progress_bar); // can know modify progress bar: yourprogressbar.setblahblah 

in order add view contains progress bar current activity, have have reference container set. so, guess did: setcontentview(r.layout.something);, have layout called something.xml; layout contains viewgroup (linearlayout, relativelayout, etc.; crystal ball can't see clearly). then, need set id container, create reference, , add newly created view it:

// in oncreate method setcontentview(r.layout.something);  // let's suppose it's linearlayout linearlayout maincontainer = (linearlayout)findviewbyid(r.id.id_you_gave_to_container);  // blha blah... rest of code. keep in mind // have declare maincontainer outside oncreate method  // here, have inflated view, , want add activity maincontainer.addview(someview); 

Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -