My problem is that i want change width of my TEXTVIEW (INPUT TEXT). In emulator that code work success but when i try to work with my app in mobile that crash it.
My answer is: Why my app crash when i try to change .setWidth? and how can i solve my problem?
A lot of thanks.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.binomial);
EditText TextVA, TextVB, TextVC, EtiquetaA, EtiquetaB, EtiquetaC;
TextVA = (EditText)findViewById(R.id.editTextP);
TextVB = (EditText)findViewById(R.id.editTextK);
TextVC = (EditText)findViewById(R.id.editText3);
ArrayList<TextView> listaTexto = new ArrayList<TextView>();
listaTexto.add(TextVA);
listaTexto.add(TextVB);
listaTexto.add(TextVC);
Display display = getWindowManager().getDefaultDisplay();
Point size = new Point();
display.getSize(size);
int y = size.y;
int x = size.x;
ResolucionPantalla respant = new ResolucionPantalla(y, x);
for (int i=0;i<listaTexto.size();i++)
//ResolInput METHOD return size in px according to the screen size
listaTexto.get(i).setWidth(respant.ResolInput());
Button BotonCalcular = (Button)findViewById(R.id.buttonCalcular);
BotonCalcular.setOnClickListener(this);
}
EDIT: TextView to EditText