Hi In my eclipse android project, whenever i try to add a xml file named options.xml the R disappears.
This is what i did,
under res folder i created a menu folder through eclipse add option. I created a xml file under that named options.xml, its contents are,
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:title="Take Picture" android:id="@+id/camera" android:icon="@drawable/ic_menu_camera" android:showAsAction="ifRoom"></item>
</menu>
but whenever i try to add that R.java disappears from auto-generation. I do not understand this. I closed and reopened eclipse, tried fresh projects no luck.
my layout main.xml,
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:orientation="horizontal">
<SurfaceView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/preview"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
</LinearLayout>
If I delete the menu folder R appears.
Since you are programming for API 10 you cannot use
android:showAsAction, that is introduced in API 11. Sorry.