Skip to content

Commit bbdc492

Browse files
committed
always create manifest when opening the editor, and update icon name
1 parent be27f88 commit bbdc492

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

mode/src/processing/mode/android/AndroidEditor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ private void loadModeSettings() {
586586
arItem.setState(true);
587587
}
588588

589-
if (save) androidMode.initManifest(sketch, appComponent);
589+
androidMode.initManifest(sketch, appComponent);
590590
} catch (IOException e) {
591591
System.err.println(AndroidMode.getTextString("android_editor.error.cannot_create_sketch_properties", sketchProps, e.getMessage()));
592592
}

mode/src/processing/mode/android/Manifest.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,15 @@ protected void load(boolean forceNew) {
345345
if (manifestFile.exists()) {
346346
try {
347347
xml = new XML(manifestFile);
348+
349+
XML app = xml.getChild("application");
350+
String icon = app.getString("android:icon");
351+
if (icon.equals("@drawable/icon")) {
352+
// Manifest file generated with older version of the mode, replace icon and save
353+
app.setString("android:icon", "@mipmap/ic_launcher");
354+
if (!forceNew) save();
355+
}
356+
348357
} catch (Exception e) {
349358
e.printStackTrace();
350359
System.err.println("Problem reading AndroidManifest.xml, creating a new version");

0 commit comments

Comments
 (0)