I'm stucked with filling an Array dynamic.
I can't find the solution. Normal I would fill the array just by any loop.
It's not working in this case I really spent hours to find a solution.
I found an example to use a custom list in android. works fine.
I create a object Test.
public class Test {
public int icon;
public int PB;
public String title;
public Test(){
super();
}
public Test(int icon, String title, int PB) {
super();
this.icon = icon;
this.title = title;
this.PB = PB;
}
}
and fill it static here works fine. But I don't get how to fill it dynamic.
Test test_data[] = new Test[]
{
new Test(R.drawable.ic_launcher, "Test 1", 10),
new Test(R.drawable.ic_launcher, "Test 2", 100)
};