55import android .content .DialogInterface ;
66import android .graphics .drawable .Drawable ;
77import android .graphics .drawable .NinePatchDrawable ;
8+ import android .graphics .Point ;
89import android .opengl .GLSurfaceView ;
910import android .os .Bundle ;
1011import android .util .Log ;
@@ -216,7 +217,9 @@ public void onCreate(Bundle savedInstanceState) {
216217 //TODO try to find a better way to get a hand on the resolution
217218 WindowManager wind = this .getWindowManager ();
218219 Display disp = wind .getDefaultDisplay ();
219- Log .d ("AndroidHarness" , "Resolution from Window, width:" + disp .getWidth () + ", height: " + disp .getHeight ());
220+ Point displaySize = new Point ();
221+ disp .getSize (displaySize );
222+ Log .d ("AndroidHarness" , "Resolution from Window, width:" + displaySize .x + ", height: " + displaySize .y );
220223
221224 // Create Settings
222225 logger .log (Level .FINE , "Creating settings" );
@@ -232,7 +235,7 @@ public void onCreate(Bundle savedInstanceState) {
232235 settings .setSamples (eglSamples );
233236 settings .setStencilBits (eglStencilBits );
234237
235- settings .setResolution (disp . getWidth (), disp . getHeight () );
238+ settings .setResolution (displaySize . x , displaySize . y );
236239 settings .setAudioRenderer (audioRendererType );
237240
238241 settings .setFrameRate (frameRate );
@@ -410,9 +413,9 @@ public void layoutDisplay() {
410413 frameLayout = new FrameLayout (this );
411414 splashImageView = new ImageView (this );
412415
413- Drawable drawable = this . getResources ().getDrawable (splashPicID );
416+ Drawable drawable = splashImageView . getContext ().getDrawable (splashPicID );
414417 if (drawable instanceof NinePatchDrawable ) {
415- splashImageView .setBackgroundDrawable (drawable );
418+ splashImageView .setBackground (drawable );
416419 } else {
417420 splashImageView .setImageResource (splashPicID );
418421 }
0 commit comments