• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Creating Progress bar dynamically

Woz

Lurker
Hi,

I am new to Android development and was wondering if this was the best way to go about what I am wanting to do. I have "Class Checkin's" Which have a max amount of people who can be checked in. So on my application I have the Class Time and under each of these class times, I want to have a horizontal progress bar that adds one to the bar each time someone checks in (On my web application I am using jquery .progressbar).
Currently I have the following:
HTML:
	private void createProgressBar(ArrayList<Integer> array, Integer maxProgress){
		View BoxProgressLayout = findViewById(R.id.BoxProgress);
		Iterator<Integer> iterator = array.iterator();
		while(iterator.hasNext()) {		
			ProgressDialog progressBar = new ProgressDialog(BoxProgressLayout.getContext());
			progressBar.setCancelable(false);
			progressBar.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
			progressBar.setProgress(0);
			progressBar.setMax(maxProgress);
			progressBar.show();
		}
	}

In order to add the progress bar to my Progress layout. But the progress bar doesn't appear on the page. Is this the best way to go about this? or am I going to have to draw my own progress bar that increments and fills by a percentage each time someone checks in.

Thanks for your help.
 
Hi
While not doing progress bars I am sure you can adapt these button dynamics to progress bars so that it does what you want. My google search string was,
"android apps creating dynamic buttons" top two results where->

http://http://stackoverflow.com/que...-dynamic-buttons-using-two-layouts-in-android

java - Android App Development, Dynamic Buttons & Fields - Stack Overflow


PS 0you did want to do this dynamicaly for some reason I got it into my head that you wanted to do it that way, although rereading your question I cant see where the dynamic bit came in.
 
Back
Top Bottom