Bearded-Hen / Android-Bootstrap

Bootstrap style widgets for Android, with Glyph Icons
MIT License
7.29k stars 1.43k forks source link

How can set data to BootstrapDropDown programmatically? #205

Open DinukaGayan opened 7 years ago

DinukaGayan commented 7 years ago

How can set data to BootstrapDropDown programmatically?

SaeedBahari commented 6 years ago

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);