android - How I can go Activity to Layout Resource file by using Intent? -


when want go 1 activity activity can go using intent this,

intent gointent = new intent(home.this, another.class); startactivity(gointent); 

but when want go 1 activity layout resource (which has no activity.java) file, how can work?

if want change layout activity, best use viewflipper. need put both layouts in 1 xml file.

layout.xml

<viewflipper android:id="@+id/viewflipper">     <relativelayout>     // here youre first layout     </linearlayout>     <relativelayout>     // here youre second layout     </relativelayout> </viewflipper> 

to switch layouts in youre activity, need call shownext():

viewflipper vf = (viewflipper) findviewbyid( r.id.viewflipper ); vf.shownext(); 

Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -