Skip to content

Commit f2b7f2e

Browse files
committed
Start the default activity
1 parent 90b3d18 commit f2b7f2e

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/processing/mode/android/AndroidRunner.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,8 @@ private void runSketchOnDevice(Sketch sketch,
213213

214214
private boolean startSketch(AndroidBuild build, final Device device) {
215215
final String packageName = build.getPackageName();
216-
final String className = build.getSketchClassName();
217216
try {
218-
if (device.launchApp(packageName, className)) {
217+
if (device.launchApp(packageName)) {
219218
return true;
220219
}
221220
} catch (final Exception e) {

src/processing/mode/android/Device.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,17 +128,17 @@ public boolean removeApp(String packageName) throws IOException, InterruptedExce
128128

129129
// different version that actually runs through JDI:
130130
// http://asantoso.wordpress.com/2009/09/26/using-jdb-with-adb-to-debugging-of-android-app-on-a-real-device/
131-
public boolean launchApp(final String packageName, final String className)
131+
public boolean launchApp(final String packageName)
132132
throws IOException, InterruptedException {
133133
if (!isAlive()) {
134134
return false;
135135
}
136136
String[] cmd = {
137-
"shell", "am", "start",
138-
"-e", "debug", "true",
139-
"-a", "android.intent.action.MAIN",
137+
"shell", "am", "start",
138+
"-e", "debug", "true",
139+
"-a", "android.intent.action.MAIN",
140140
"-c", "android.intent.category.LAUNCHER",
141-
"-n", packageName + "/." + className
141+
"-n", packageName + "/.MainActivity"
142142
};
143143
// PApplet.println(cmd);
144144
ProcessResult pr = adb(cmd);

0 commit comments

Comments
 (0)