I have some strange problem. I have a layout in xml with id's assign to elements. While I try to get they using findViewById method I get null. Even in anddev tutorials made by copy and paste the sources from the site.
Using java Syntax Highlighting
- public class M5test extends Activity {
- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- setContentView(R.layout.test);
- Button okButton = (Button)findViewById(R.id.ok_button);
- Button clearButton = (Button)findViewById(R.id.clear_button);
Parsed in 0.030 seconds, using GeSHi 1.0.8.4
and test.xml file :
Using xml Syntax Highlighting
- <Button id="@+id/ok_button"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@id/keyword_entry"
- android:layout_alignParentRight="true"
- android:layout_marginLeft="10px"
- android:text="OK" />
- <Button id="@+id/clear_button"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_toLeft="@id/ok_button"
- android:layout_alignTop="@id/ok_button"
- android:text="Clear" />
Parsed in 0.002 seconds, using GeSHi 1.0.8.4
anybody experienced similar problem? Is is something related to m5?
regards




