layout - Android: from surfaceview back to the menu -


i making simple game in draw set of bitmaps on canvas on surface view.. in main activity have linear layout have designed button. in onclick of button write:

setcontentview(new surfaceviewclass(this)); 

it works fine...it opens surfaceview play game etc.. want re view button started mean when game on want menu reappear.. have tried calling void like

main.menu(); 

but app crashes.. please help.

make new activity class , write in oncreate() method of it

setcontentview(new surfaceviewclass(this)); 

and in previous activity create intent , start new activity when button clicked

e.g ....// onclick method of btn on old activity     {         intent i=new intent(oldclass.this, newclass.class);         startactivity(i);     }     .... 

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -