Метод setText () возвращает ноль в моем приложении, почему?
public class GetValue extends Activity {
char letter = 'g';
int ascii = letter;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TextView textView = (TextView)findViewById(R.id.txt_1);
textView.setText(ascii);
}
}
Неважно, какой текст я вставил, он все равно вылетает.Почему setText () продолжает возвращать ноль?
Заранее спасибо
Решение: Моя ошибка была в файле xml.Я написал: android: text = "@ + id / txt_1" Когда следует сказать: android: id = "@ + id / txt_1"
Большое спасибо за все ответы и комментарии!