Possibility of having Landscape and portrait orientation in same activity at different instance
I have two layout xml files and i want

one.xml in portrait mode for first 2 minutes and
two.xml in landscape mode after that

below is my implementation. It works fine till one.xml but while calling two.xml it pops up error. Is there any other way or can i make any changes to my approach


    public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
    this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);	
	setContentView(R.layout.one);


	// final Intent intent1= new Intent(this,LivetvpocActivity.class);	
	Handler handler = new Handler();
	handler.postDelayed(new Runnable() {
	    @Override
	    public void run() {

    	secondxml();
	    }
	}, 2000);
	
    }	

    public void  secondxml()
    {

    this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);	
	setContentView(R.layout.two);   

    }
Possibility of having Landscape and portrait orientation in same activity at different instance
===

I have two layout xml files and i want

one.xml in portrait mode for first 2 minutes and
two.xml in landscape mode after that

below is my implementation. It works fine till one.xml but while calling two.xml it pops up error. Is there any other way or can i make any changes to my approach


    public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
    this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);	
	setContentView(R.layout.one);


	// final Intent intent1= new Intent(this,LivetvpocActivity.class);	
	Handler handler = new Handler();
	handler.postDelayed(new Runnable() {
	    @Override
	    public void run() {

    	secondxml();
	    }
	}, 2000);
	
    }	

    public void  secondxml()
    {

    this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);	
	setContentView(R.layout.two);   

    }