[英]even though I create a Blank Fragment with attached xml layout. my Fragment java dont connet with fragment layout
Here is the java code with error这是有错误的java代码
public class fragemnt extends Fragment {
public fragemnt() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_fragemnt, container, false);
}
} }
here my javaFragment cannot find the Fragement_fragment layout eventhough the xml file shows in the layout direcotry这里我的 javaFragment 找不到 Fragment_fragment 布局,即使 xml 文件显示在布局目录中
heres my Xml file这是我的 Xml 文件
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".FirstSemester.fragemnt">
<!-- TODO: Update blank fragment layout -->
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/hello_blank_fragment" />
</FrameLayout>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.