I am using Android annotation in inflate the Fragment:
@EFragment(R.layout.fragment_sample)
public class SampleFragment extends Fragment {
public static SampleFragment newInstance(Context context) {
mContext = context;
SampleFragment samplefragment = new SampleFragment_();
return samplefragment;
}
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState){
super.onActivityCreated(savedInstanceState);
}
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
}
@AfterViews
public void afterViewsCreated(){
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(mContext);
}}
I am invoking the instance of above fragment class from an Activity:
SampleFragment.newInstance(getApplicationContext());
After enabling debug point in the code. Code flow is only limited to newInstance method. Debugger is not even going to onActivityCreated() , onCreate() and afterViewsCreated(). @AfterViews needs to be get called.
Why is this so happening?