I knew there was something that I missed. Thanks to all who shed
light on this thread. Here's the final code for those newbies who may
have the same problem.
package com.HelloWorld;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClick
You still need to specify the tv variable type (of course, think about
it!!!).
TextView tv = (TextView) findViewById(R.id.TextView01);
Best regards,
Filip Havlicek
2010/9/1 rb
> As a newbie, I am just trying to program the various functions to
> ensure that I am doing things right (gui wise).
As a newbie, I am just trying to program the various functions to
ensure that I am doing things right (gui wise).
An example would be to set a default template with textview, editview,
buttons, etc and just changing
the parameters of those objects either by direct (as by this code) or
by calling a
Thanks for the suggestions San and Fllip. I have tried the example
that San gave but still errors. Here's the revised code in the
main.xml file:
package com.HelloWorld;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
imp
As Havlicek said, create the textview using findViewByID and set the
text when button is clicked.
Sample code:
tv = (TextView) findViewById(R.id.TextView01);
tv.setText("This is sample.");
Button button = (Button) findViewById(R.id.Button01);
button.setOnClickListener(new OnClickListener() {
publ
Any suggestions on why I am getting the "false" reading --> in the
xml , set the button propert android:clickable" as true,
anyone
can suggest on how to place the results in a TextView via a button
click, that would be appreciated.
as i can c u have the listener to the button,
on click
can u b
6 matches
Mail list logo