Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4362: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4364: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4365: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4366: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
anddev.org • View topic - XML: Can you create a button with a variable text field?

XML: Can you create a button with a variable text field?

Put your problem here if it does not fit any of the other categories.

XML: Can you create a button with a variable text field?

Postby Lita » Fri Mar 28, 2008 2:34 am

Hi. This is my first time posting and I am kind of a novice with XML. I didn't know where to post this question. But I thought out of all the categories, this section was the best fit. So I want several classes to use an this XML layout with several buttons. However, depending on the class, I want the text of the buttons to say different things with different functionality. Is there a way to display a button with varying text depending on a class that is using the layout? Any help would be greatly appreciated!
Lita
Freshman
Freshman
 
Posts: 2
Joined: Fri Mar 28, 2008 2:26 am

Top

Postby Jesmiatka » Fri Mar 28, 2008 9:03 am

Hi,

why don't you set it in the oncreate of the java class?

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.                 button = (Button) this.findViewById(R.id.buttonid);
  2.  
  3.                 button.setText("LOLCAKES");
Parsed in 0.011 seconds, using GeSHi 1.0.8.4
Jesmiatka
Senior Developer
Senior Developer
 
Posts: 164
Joined: Mon Feb 04, 2008 3:37 pm
Location: Netherlands

Postby Lita » Fri Mar 28, 2008 10:15 pm

I totally forgot about that! Thank you so much. So is the text within the button optional? I always thought it was required. but my experience of XML was only through DroidDraw.
Lita
Freshman
Freshman
 
Posts: 2
Joined: Fri Mar 28, 2008 2:26 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Exabot [Bot] and 11 guests