Skip to content

Commit 947eb39

Browse files
authored
fix(android): crash on orientation change due to activity recreation (#6261)
1 parent 65e487f commit 947eb39

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed

.changes/fix-orientation-crash.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"cli.rs": patch
3+
"cli.js": patch
4+
---
5+
6+
Update Android project template with fix to crash on orientation change.

examples/api/src-tauri/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tooling/cli/templates/mobile/android/app/src/main/AndroidManifest.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
android:theme="@style/Theme.{{snake-case app.name}}"
88
android:usesCleartextTraffic="${usesCleartextTraffic}">
99
<activity
10+
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode"
11+
android:launchMode="singleTask"
12+
android:label="@string/main_activity_title"
1013
android:name=".MainActivity"
1114
android:exported="true">
1215
<intent-filter>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
<resources>
22
<string name="app_name">{{app.stylized-name}}</string>
3+
<string name="main_activity_title">{{app.stylized-name}}</string>
34
</resources>

0 commit comments

Comments
 (0)