android - surfaceCreated not called -


I put a log in the method, and it never reports the run () method of the game is executed, But I wait for the defense to the surface. The method of return before proceeding.

Notes: Game thread and touchpane SurfaceView applies SurfaceHolder.Clallback

  Private Final Zero Run Game () {savedPos = 0; resume game(); Touch Panel = (TouchPlanel) Find VVBID (Com. MISITMGMRID TouchPanel); TouchPanel.setMinimumHeight (displayWidth); TouchPanel.setParams (this, WriteLock, gemSize9, gemSize12, Way); TextUpdate = new text update (this, D); Village = new game (tok9, tok12, m, d, this, texthandler, textUpdate, touchpanel, marg, gemSize9, gemSize12, readLock, writeLock); InitBitmaps (); Gm.start (); } Private Final Welcome again () {loadBGMusic (); Layout = layout. GAME; SetContentView (com.mysite.mygame.R.layout.game); WriteLock.lock (); Try {paused = false; } Finally {writeLock.unlock (); }} & Lt; RelativeLayout xmlns: Android = "http://schemas.android.com/apk/res/android" Android: Android: Android: layout_width = "fill_parent" Android: layout_height = "fill_parent" Android: background = "@drawable / backtraple" Android: keepScreenOn = "true" & gt; & Lt; Com.mysite.mygame.TouchPanel Android: Android: Android: layout_width = "fill_parent" Android: layout_height = "0dp" Android: Clickable = "True" Android: Focusac Inboxed = "True" /> & Lt; / RelativeLayout & gt; Public TouchPanel (Reference Reference, Attribatets Atters) {Super (References, ethers); . GetHolder () addCallback (this); }    

I thought it.

  @ Id / touchpanel should be   

  android: layout_height! = 0   

and

  Android: Layout_width! = 0   

The surface can be made in a surface view.

Comments