Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Get the text of a Button and use it as a text for TextView(Need to get the text of a button and use it for a TextView item)
Get the text of a Button and use it as a text for TextView [message #812381] Sat, 03 March 2012 18:32
Halim Ismail is currently offline Halim IsmailFriend
Messages: 1
Registered: March 2012
Junior Member
Hi

As the title says...
I have the following codes

Button theb5title;

Quote:
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.browser);
Uri url = getIntent().getData();

WebView webView = (WebView) findViewById(R.id.WebView01);
webView.setWebViewClient(new Callback());
webView.loadUrl(url.toString());


theb5title = (Button) findViewById(R.id.btn_launchMyBrowser);

String taketitle = theb5title.getText().toString();
TextView mytitle = (TextView) findViewById(R.id.titleText);
mytitle.setText(taketitle);

But i always have error on these 3 lines:
Quote:
String taketitle = theb5title.getText().toString();
TextView mytitle = (TextView) findViewById(R.id.titleText);
mytitle.setText(taketitle);


Help.. =(
Previous Topic:Team -> Share Project...
Next Topic:remote deploy from eclipse
Goto Forum:
  


Current Time: Thu Mar 28 18:32:32 GMT 2024

Powered by FUDForum. Page generated in 0.04527 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top