i have one xml file called activity_main.xml in both orientation portrait/landscape. The problem is that xml is with same name but tags inside are completly different. Is it possible to force activity when enter at OnCreate method, based on some criteria to use only portrait mode. Setting screen orientation in Manifest dont work for my situation.
I tried this:
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT)
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
The problem comes when user try to open activity in landscape mode etc phone is in landscape mode before open MainActivity
and setContentView(R.layout.activity_main);
tried to get activity_main.xml from land folder but i want to get view from portrait, is it possible or my logic is wrong.