Tried and tested this one it's working absolutely fine.
public class buttonCustom extends Button{
String s="";
public buttonCustom(Context context) {
super(context);
}
public buttonCustom(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
// TODO Auto-generated constructor stub
}
public buttonCustom(Context context, AttributeSet attrs) {
super(context, attrs);
// TODO Auto-generated constructor stub
}
@Override
public void setText(CharSequence text, BufferType type) {
// TODO Auto-generated method stub
// TODO Auto-generated method stub
for(int i=0;i<text.length();i++)
{
if(s==null)
s="";
s= s+String.valueOf(text.charAt(i))+ "\n";
}
super.setText(s, type);
}
}
Override button class and override the setText function
a
, not elegent solution but will work – Waqas Mar 06 '13 at 11:47