This is my class file :
public class FragmentOne extends Fragment {
public static Fragment newInstance(Context context) {
FragmentOne f = new FragmentOne();
return f;
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
ViewGroup root = (ViewGroup) inflater.inflate(R.layout.fragment_one, null);
return root;
}
}
这是我的布局名称fragment_one.xml,当我尝试在类中调用fragment_one然后它应该在控制台中出错此错误即将来临:
[2013-08-27 10:33:52 - FragmentPart] res \ layout \ fragmentone.xml:文件名无效:必须只包含[a-z0-9_。] 如何修复此错误请帮帮我
这是frgmentone.xml的代码:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="one" />
</RelativeLayout>