Code 1:
public void displayQuantity(int number) {
TextView quantityTV = (TextView) findViewById(R.id.quantity_tv);
quantityTV.setText( " "+ number);
}
Code 2:
public void displayQuantity(int number) {
TextView quantityTV = (TextView) findViewById(R.id.quantity_tv);
quantityTV.setText(number);
}
Why Code 2 gives error while code 1 doesn't?? There is a difference of - " __ " in b/w code 1 & 2