Skip to content

Display and control your Android device

Simplify Application instantiation

Romain Vimont8c3e2bae7be4
diff --git a/server/src/main/java/com/genymobile/scrcpy/Workarounds.java b/server/src/main/java/com/genymobile/scrcpy/Workarounds.java
index b8ee68ca..e8da9540 100644
--- a/server/src/main/java/com/genymobile/scrcpy/Workarounds.java
+++ b/server/src/main/java/com/genymobile/scrcpy/Workarounds.java
@@ -143,7 +143,7 @@ public final class Workarounds {
try {
fillActivityThread();
- Application app = Application.class.newInstance();
+ Application app = new Application();
Field baseField = ContextWrapper.class.getDeclaredField("mBase");
baseField.setAccessible(true);
baseField.set(app, FakeContext.get());