mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-11 23:54:18 +00:00
Android: fix to prevent app restarts when rotating.
This commit is contained in:
parent
06a4980792
commit
7c8eb56f04
4 changed files with 18 additions and 1 deletions
|
|
@ -293,6 +293,7 @@ private:
|
|||
XmlElement* act = app->createNewChildElement ("activity");
|
||||
act->setAttribute ("android:name", getActivityName());
|
||||
act->setAttribute ("android:label", "@string/app_name");
|
||||
act->setAttribute ("android:configChanges", "keyboardHidden|orientation");
|
||||
|
||||
XmlElement* intent = act->createNewChildElement ("intent-filter");
|
||||
intent->createNewChildElement ("action")->setAttribute ("android:name", "android.intent.action.MAIN");
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
<uses-feature android:glEsVersion="0x00020000" android:required="true"/>
|
||||
<application android:label="@string/app_name" android:icon="@drawable/icon">
|
||||
<activity android:name="JuceDemo" android:label="@string/app_name">
|
||||
<activity android:name="JuceDemo" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ import android.app.AlertDialog;
|
|||
import android.content.DialogInterface;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Configuration;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.view.*;
|
||||
|
|
@ -70,6 +71,13 @@ public final class JuceDemo extends Activity
|
|||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfigurationChanged (Configuration cfg)
|
||||
{
|
||||
super.onConfigurationChanged (cfg);
|
||||
setContentView (viewHolder);
|
||||
}
|
||||
|
||||
private void callAppLauncher()
|
||||
{
|
||||
launchApp (getApplicationInfo().publicSourceDir,
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ import android.app.AlertDialog;
|
|||
import android.content.DialogInterface;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Configuration;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.view.*;
|
||||
|
|
@ -70,6 +71,13 @@ public final class JuceAppActivity extends Activity
|
|||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfigurationChanged (Configuration cfg)
|
||||
{
|
||||
super.onConfigurationChanged (cfg);
|
||||
setContentView (viewHolder);
|
||||
}
|
||||
|
||||
private void callAppLauncher()
|
||||
{
|
||||
launchApp (getApplicationInfo().publicSourceDir,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue