fix(Application): getNativeApplication wrong ActivityThread (#10326)

fixes #10325
This commit is contained in:
Igor Randjelovic
2023-06-23 18:16:54 +02:00
committed by GitHub
parent ed0989d96e
commit 029ed4fe5d

View File

@ -323,7 +323,7 @@ export class AndroidApplication extends ApplicationCommon implements IAndroidApp
// the getInstance might return null if com.tns.NativeScriptApplication exists but is not the starting app type
if (!nativeApp) {
// TODO: Should we handle the case when a custom application type is provided and the user has not explicitly initialized the application module?
const clazz = java.lang.Class.forName('androidx.appcompat.app.AppCompatActivityThread');
const clazz = java.lang.Class.forName('android.app.ActivityThread');
if (clazz) {
const method = clazz.getMethod('currentApplication', null);
if (method) {