display list of some words by clicking a button [message #1053192] |
Fri, 03 May 2013 00:44  |
Eclipse User |
|
|
|
Hi,
I am new to eclipse. Now i've created a simple project using eclipse.By clicking the button the word is viewed.
Like if my button is CLICK ME and my word is hello welcum.
By clicking the button the "hello welcum" is viewed.
But now i'm trying to view more than a word.
Like
"hello welcum"
"have a nice day"
"hai"
Like this i want to do.
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//Creating Button variable
Button button = (Button) findViewById(R.id.bt);
//Adding Listener to button
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
//Creating TextView Variable
TextView text = (TextView) findViewById(R.id.tv);
//Sets the new text to TextView (runtime click event)
text.setText("hello welcum");
}
});
}
The above is my sample code. Please help me how to do.
|
|
|
|
Powered by
FUDForum. Page generated in 0.10832 seconds