I know this is very basic question, but I need to know, how I can display the contents of a variable on the screen.
Do I use a textview in my layout?
I have
In the Activity...
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
int myValue = deriveMyValue();
String message =
myValue == -1 ?
"The value is invalid." :
"The value is " + myValue;
TextView tv = (TextView) findViewById(R.id.my_text_view);
tv.setText(message);
}