I am trying to inflate one of my fragments. However, the fragment does not show up in the autosuggest. So I manually entered the name of the fragment. By doing that the fragment name was showing in red text color and also red squiggly lines showing below all of the class names. However, when I run the application, it runs perfectly without any errors.
I have three fragments: fragment_dynamic_android.xml, fragment_dynamic_windows.xml and fragment_dynamic_ios.xml.
I can able to inflate the fragment_dynamic_android.xml in AndroidFragment.java class on onCreateView method.
But when I try to inflate the fragment_dynamic_windows.xml on WindowsFragment.java's onCreateView method.
The red textcolor is showing on
View rootView = inflater.inflate(R.layout.fragment_dynamic_windows, container, false);
The applications run without any error.
package app.tab.simple.fragmenttut;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
public class WindowsFragment extends Fragment {
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_dynamic_windows, container, false);
return rootView;
}
}
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)