java - problems with R - ANDROID -
when create layout called " main.xml ":
<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:padding="10dip" android:layout_width="fill_parent" android:layout_height="wrap_content"> <button android:id="@+id/button" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/button" /> <spinner android:id="@+id/spinner" android:layout_width="fill_parent" android:layout_height="wrap_content" /> </linearlayout>
when go main create button " button = (button) findviewbyid(r.id.button); " have error , cant find button in r.id , same spinner id dont exist in r.id
help me plz
you're importing wrong version of r. there 2 versions exist: static r class exists in android.r , there yourpackagename.r. if import former none of ids found.
Comments
Post a Comment