You tried to pass an integer as a parameter to setText, which assumes this is a resource identifier. To display the calculated text, pass it as a string:textView.setText("g");
: XML , - ,
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:id="@+id/txt_1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="myTextView"/>
</LinearLayout>
, (Project- > Clean in Eclipse), R- ADT.