1
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>
4

0 回答 0