Android-Bootstrap
Android-Bootstrap copied to clipboard
How can set data to BootstrapDropDown programmatically?
How can set data to BootstrapDropDown programmatically?
if You have Array inside String.xml You can use this: BTD.setDropdownData("@array/*****");
if you don't have, you want set data from Your Database, You must create a method with Object return.. why? because you need TWO argument first count of data ,second value of data.. you can use this snippet code:
DBHandler handler = new DBHandler(this); Object[] a = handler.QueryDropDown(); Count= (int) a[1]; Value= new String[Count]; Value= (String[]) a[0]; BTD.setDropdownData(Value);