HI ,
I want to create buttons dynamically,
My code is
Button b1[] = null;
for(int i=0;i<10;i++)
{
b1 = new Button(this);
b1.setOnClickListener(this);
- - - - - - - --
- - - - - - --
}
But after running my code it is showing Null Pointer exception at creating the button. (new Button(this))
Can anyone suggest how to create dynamically buttons,
Please help
I want to create buttons dynamically,
My code is
Button b1[] = null;
for(int i=0;i<10;i++)
{
b1 = new Button(this);
b1.setOnClickListener(this);
- - - - - - - --
- - - - - - --
}
But after running my code it is showing Null Pointer exception at creating the button. (new Button(this))
Can anyone suggest how to create dynamically buttons,
Please help