i have installed on my ubuntu eclipse and the android sdk and adt.
now, if i create a new android project immediately after i create it i see bugs in Mainactivity.java: R cannot be resolved
. i added import android.R
and now it says that activity_main cannot be resolved or is not a field
it says i can change it to activity_list_item
but then it lists other bugs. this problem appears also if i import sample projects or project which was done already in an other computer.
i know this question was already asked many times but i couldnt fix it like written there.
thank you,
Boaz Code: MainActivity.java:
package com.example.test;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
}
BuildConfig.java:
/** Automatically generated file. DO NOT MODIFY */
package com.example.test;
public final class BuildConfig {
public final static boolean DEBUG = true;
} activity_Main.xml:
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:id="@+id/menu_settings"
android:orderInCategory="100"
android:showAsAction="never"
android:title="@string/menu_settings"/>
</menu>