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

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 - Problems with LinearLayout and Button ad

Problems with LinearLayout and Button ad

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

Problems with LinearLayout and Button ad

Postby mihailo » Thu Mar 20, 2008 2:07 pm

Hello,

I'am trying to add an Dynamicly created Button to an pre-defined (xml) LinearLayout.

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. LinearLayout lay = (LinearLayout) findViewById(R.id.content2);
  3.  
  4.      
  5.  
  6.         Button but = new Button(this);
  7.  
  8.         but.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));
  9.  
  10.         but.setText("Hallo");
  11.  
  12.        
  13.  
  14.         lay.addView(but);
  15.  
  16.  
Parsed in 0.013 seconds, using GeSHi 1.0.8.4


but i get the error message : java.lang.IllegalArgumentException: Invalid LayoutParams supplied to android.widget.
LinearLayout@400b6c28.

What's wrong :cry: please help
mihailo
Once Poster
Once Poster
 
Posts: 1
Joined: Thu Mar 20, 2008 1:51 pm

Top

Postby michael_g_hu » Fri Mar 21, 2008 9:55 am

I think you should use LinearLayout.LayoutParams as the params setting
michael_g_hu
Developer
Developer
 
Posts: 35
Joined: Fri Mar 21, 2008 9:46 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 7 guests