package com.example.helloworld;
import android.app.Activity;
import android.os.Bundle;
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.main, menu);
return true;
}
}
先是R出现红线,问题是R cannot be resolved to a variable
然后我fix了一下出现package snippet;
public class Snippet {
检查build path
}
,请问如何解决
------解决方案--------------------
我也遇到过这样的问题,fix出现那个东东删除就好,然后再Build Project一下应该就没问题了,我设置是手动build的。