Reputation: 189
Here is the java code with error
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
heres my Xml file
<?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>
Upvotes: 1
Views: 156
Reputation: 286
try to clean, the click on build. if it did not work try to invalidate cache and restart
Upvotes: 1