我正在使用eclipse 4.4 (Luna)
并尝试创建自己的片段:
public static class PlaceholderFragment extends Fragment {
public PlaceholderFragment() { }
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_display_message,
container, false);
return rootView;
}
}
我在R.layout.fragment_display_message,
上有错误,如下所示:
fragment_display message cannot be resolved or is not a field.
2 quick fixes available:
- Create field fragment_display_message in type 'layout'
- Create constant fragment_display_message in type 'layout'
点击其中任何一个时,在field/constant
文件中创建XML
我收到以下错误:
[2014-08-12 10:56:26 - MyFirstApp] R.java was modified manually! Reverting to generated version!
有没有人知道如何解决这个问题?
答案 0 :(得分:1)
两种可能性
android.R
R