fix crash victoire

This commit is contained in:
marc barbier
2021-01-10 22:53:50 +01:00
parent bead53795d
commit 8582021ca4
3 changed files with 6 additions and 6 deletions
+3 -2
View File
@@ -16,7 +16,6 @@
<activity android:name=".Credit"></activity> <activity android:name=".Credit"></activity>
<activity <activity
android:name=".MainActivity" android:name=".MainActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait"> android:screenOrientation="portrait">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
@@ -26,7 +25,9 @@
</activity> </activity>
<activity <activity
android:name=".GameActivity" android:name=".GameActivity"
android:screenOrientation="landscape"> android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="landscape"
android:keepScreenOn="true">
<intent-filter> <intent-filter>
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter> </intent-filter>
@@ -33,7 +33,7 @@ public class PopupRunable implements Runnable{
public static void makePopup(Activity activity,int stringId) public static void makePopup(Activity activity,int stringId)
{ {
String recivedMessage = activity.getResources().getString(stringId); String recivedMessage = activity.getResources().getString(stringId);
new PopupRunable(activity,recivedMessage).run(); activity.runOnUiThread(new PopupRunable(activity,recivedMessage));
} }
/** /**
@@ -43,6 +43,6 @@ public class PopupRunable implements Runnable{
*/ */
public static void makePopup(Activity activity,String message) public static void makePopup(Activity activity,String message)
{ {
new PopupRunable(activity,message).run(); activity.runOnUiThread(new PopupRunable(activity,message));
} }
} }
@@ -41,13 +41,12 @@ public class GameActivity extends Activity {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
} }
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
String deck = getIntent().getStringExtra("DECK"); String deck = getIntent().getStringExtra("DECK");
renderer = new Renderer(getBaseContext(),deck,this); renderer = new Renderer(getBaseContext(),deck,this);
setContentView(renderer); setContentView(renderer);
} }