I could not remember how to change the textView field after the start of the program. I got an error that was caused by the int to string conversion. I finally got my code to work and I decided to share it.
I added a button to make the application more interactive
public class Main extends Activity
/** Called when the activity is first created. */
public void onCreate(Bundle savedInstanceState)
add = (Button) findViewById(R.id.button1);
tv = (TextView) this.findViewById(R.id.TextView01);
tv.setText("0"); //the starting value
int counter = 0;
String s = "";
public void onClick(View v)
s = Integer.toString(counter); //change to string
tv.setText(s); //the text will be changed here.
I am sure that I ran into a better method of adding text to the TextView. I just wanted to publish this here as it might help others getting something running. If you can see any areas where I can refine my code then please post it in the comments.