[Corona Native] How can I add methods to CoronaActivity?

I used "public class MainActivity extends CoronaActivity"in 32bit Corona era.

I know it is not recommendation. But it’s good and easy.

So, now. 64bit Corona era. It doesn’t support the method.

I must add a code below.

@Override public void onWindowFocusChanged(boolean hasFocus) { super.onWindowFocusChanged(hasFocus); if (hasFocus) { getWindow().getDecorView().setSystemUiVisibility( View.SYSTEM\_UI\_FLAG\_LAYOUT\_STABLE | View.SYSTEM\_UI\_FLAG\_LAYOUT\_HIDE\_NAVIGATION | View.SYSTEM\_UI\_FLAG\_LAYOUT\_FULLSCREEN | View.SYSTEM\_UI\_FLAG\_HIDE\_NAVIGATION | View.SYSTEM\_UI\_FLAG\_FULLSCREEN | View.SYSTEM\_UI\_FLAG\_IMMERSIVE\_STICKY); } }

How can I?

And…

How can I add a code below to CoronaActivity in AndroidManifest.template.xml?

\<intent-filter\> \<action android:name="android.intent.action.VIEW"/\> \<category android:name="android.intent.category.DEFAULT"/\> \<category android:name="android.intent.category.BROWSABLE" /\> \<data android:scheme="myapp" /\> \</intent-filter\>

I’m not sure what changed. You can still override CoronaActivity, and change manifest to your needs.

But two app icons are created if I add my MainActivity to manifest.

\<activity android:name=".MainActivity" android:configChanges="keyboard|keyboardHidden|navigation|screenSize|orientation" android:windowSoftInputMode="stateAlwaysVisible|adjustPan" android:label="@string/app\_name" android:launchMode="singleTask" android:screenOrientation="portrait" android:theme="@android:style/Theme.NoTitleBar.Fullscreen"\> \<meta-data android:name="coronaWindowMovesWhenKeyboardAppears" android:value="true"/\> \<intent-filter\> \<action android:name="android.intent.action.MAIN" /\> \<category android:name="android.intent.category.DEFAULT"/\> \<category android:name="android.intent.category.LAUNCHER" /\> \</intent-filter\>

Because corona generates the manifest default. CoronaActivity is LAUNCHER.

Making LAUNCHER is two, two app icons are made.

So, I can not use my MainActivity extends CoronaActivity.

And I can not cast CoronaActivity to MainActivity. It throws Error.

And another thing…zip plugin is not working in corona 64bit. (I don’t notice it where)

https://marketplace.coronalabs.com/corona-plugins/zip

Pretty sure zip works on 64bit. It should. Btw, I recomend creating a new project from template. It has gradle target 'setUpCoronaAppAndPlugins` which will download and setup all the plugins in build.settings. It also overrides the manifest, so make your changes/back up your manifest.

To fix two activities, you can delete Corona Activity in your main manifest file by adding something like this to your application node:

<activity android:name=“com.ansca.corona.CoronaActivity” tools:node=“remove” />

it will delete original activity on merge

Thank you very much. App icon is resolved.

But it has crashed in zip time.

Logcat:

A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV\_MAPERR), fault addr 0x48 in tid 20304 (GLThread 50045), pid 19988 (o.myapp)
2019-11-12 14:51:23.660 27646-27646/? A/DEBUG: backtrace: 2019-11-12 14:51:23.660 27646-27646/? A/DEBUG: #00 pc 0000000000032c60 /data/app/com.mycompany.app-IvqciOyWOSjCi4JQvz4XGw==/lib/arm64/libplugin.zip.so 2019-11-12 14:51:23.660 27646-27646/? A/DEBUG: #01 pc 0000000000032c74 /data/app/com.mycompany.app-IvqciOyWOSjCi4JQvz4XGw==/lib/arm64/libplugin.zip.so 2019-11-12 14:51:23.660 27646-27646/? A/DEBUG: #02 pc 0000000000032d04 /data/app/com.mycompany.app-IvqciOyWOSjCi4JQvz4XGw==/lib/arm64/libplugin.zip.so 2019-11-12 14:51:23.661 27646-27646/? A/DEBUG: #03 pc 0000000000032154 /data/app/com.mycompany.app-IvqciOyWOSjCi4JQvz4XGw==/lib/arm64/libplugin.zip.so 2019-11-12 14:51:23.661 3907-13751/? D/ConnectivityService: filterNetworkStateForUid() uid: 1110024, pid: 3907, networkInfo: [type: WIFI[], state: CONNECTED/CONNECTED, reason: (unspecified), extra: (none), failover: false, available: true, roaming: false] 2019-11-12 14:51:23.661 27646-27646/? A/DEBUG: #04 pc 00000000000318f0 /data/app/com.mycompany.app-IvqciOyWOSjCi4JQvz4XGw==/lib/arm64/libplugin.zip.so 2019-11-12 14:51:23.661 27646-27646/? A/DEBUG: #05 pc 0000000000031a1c /data/app/com.mycompany.app-IvqciOyWOSjCi4JQvz4XGw==/lib/arm64/libplugin.zip.so 2019-11-12 14:51:23.661 3907-13751/? D/ConnectivityService: filterNetworkStateForUid() uid: 10024, pid: 3907 2019-11-12 14:51:23.661 27646-27646/? A/DEBUG: #06 pc 0000000000032898 /data/app/com.mycompany.app-IvqciOyWOSjCi4JQvz4XGw==/lib/arm64/libplugin.zip.so (operator new(unsigned long)+124) 2019-11-12 14:51:23.661 3907-13751/? D/ConnectivityService: isNetworkWithLinkPropertiesBlocked: uid=10024, vpn=DISCONNECTED,false 2019-11-12 14:51:23.661 27646-27646/? A/DEBUG: #07 pc 0000000000027110 /data/app/com.mycompany.app-IvqciOyWOSjCi4JQvz4XGw==/lib/arm64/libplugin.zip.so 2019-11-12 14:51:23.661 27646-27646/? A/DEBUG: #08 pc 0000000000027144 /data/app/com.mycompany.app-IvqciOyWOSjCi4JQvz4XGw==/lib/arm64/libplugin.zip.so 2019-11-12 14:51:23.661 3907-13751/? D/ConnectivityService: filterNetworkStateForUid() uid: 10024, pid: 3907, networkInfo: [type: WIFI[], state: CONNECTED/CONNECTED, reason: (unspecified), extra: (none), failover: false, available: true, roaming: false] 2019-11-12 14:51:23.661 27646-27646/? A/DEBUG: #09 pc 000000000002bda4 /data/app/com.mycompany.app-IvqciOyWOSjCi4JQvz4XGw==/lib/arm64/libplugin.zip.so 2019-11-12 14:51:23.661 27646-27646/? A/DEBUG: #10 pc 0000000000030a2c /data/app/com.mycompany.app-IvqciOyWOSjCi4JQvz4XGw==/lib/arm64/libplugin.zip.so (Corona::AsyncZip::Compress(lua\_State\*)+3532) 2019-11-12 14:51:23.661 3907-13751/? D/ConnectivityService: filterNetworkStateForUid() uid: 10125, pid: 3907 2019-11-12 14:51:23.661 3907-13751/? D/ConnectivityService: isNetworkWithLinkPropertiesBlocked: uid=10125, vpn=DISCONNECTED,false 2019-11-12 14:51:23.661 27646-27646/? A/DEBUG: #11 pc 0000000000025034 /data/app/com.mycompany.app-IvqciOyWOSjCi4JQvz4XGw==/lib/arm64/libplugin.zip.so (Corona::ZipLibrary::zipCompress(lua\_State\*)+36) 2019-11-12 14:51:23.661 27646-27646/? A/DEBUG: #12 pc 0000000000013c4c /data/app/com.mycompany.app-IvqciOyWOSjCi4JQvz4XGw==/lib/arm64/liblua.so 2019-11-12 14:51:23.661 3907-13751/? D/ConnectivityService: filterNetworkStateForUid() uid: 10125, pid: 3907, networkInfo: [type: WIFI[], state: CONNECTED/CONNECTED, reason: (unspecified), extra: (none), failover: false, available: true, roaming: false] 2019-11-12 14:51:23.661 27646-27646/? A/DEBUG: #13 pc 00000000000288f4 /data/app/com.mycompany.app-IvqciOyWOSjCi4JQvz4XGw==/lib/arm64/liblua.so 2019-11-12 14:51:23.661 27646-27646/? A/DEBUG: #14 pc 0000000000014238 /data/app/com.mycompany.app-IvqciOyWOSjCi4JQvz4XGw==/lib/arm64/liblua.so 2019-11-12 14:51:23.661 3907-13751/? D/ConnectivityService: Vpn: getActiveNetworkForUidInternal: 10231, false, false, DISCONNECTED 2019-11-12 14:51:23.661 27646-27646/? A/DEBUG: #15 pc 00000000000135ac /data/app/com.mycompany.app-IvqciOyWOSjCi4JQvz4XGw==/lib/arm64/liblua.so 2019-11-12 14:51:23.661 3907-13751/? D/ConnectivityService: isNetworkWithLinkPropertiesBlocked: uid=10231, vpn=DISCONNECTED,false 2019-11-12 14:51:23.661 27646-27646/? A/DEBUG: #16 pc 0000000000014560 /data/app/com.mycompany.app-IvqciOyWOSjCi4JQvz4XGw==/lib/arm64/liblua.so 2019-11-12 14:51:23.661 27646-27646/? A/DEBUG: #17 pc 000000000000a810 /data/app/com.mycompany.app-IvqciOyWOSjCi4JQvz4XGw==/lib/arm64/liblua.so (lua\_pcall+164) 2019-11-12 14:51:23.661 3907-13751/? D/ConnectivityService: filterNetworkStateForUid() uid: 10231, pid: 3907 2019-11-12 14:51:23.661 27646-27646/? A/DEBUG: #18 pc 000000000000631c /data/app/com.mycompany.app-IvqciOyWOSjCi4JQvz4XGw==/lib/arm64/libjnlua5.1.so (Java\_com\_naef\_jnlua\_LuaState\_lua\_1pcall+464) 2019-11-12 14:51:23.661 3907-13751/? D/ConnectivityService: isNetworkWithLinkPropertiesBlocked: uid=10231, vpn=DISCONNECTED,false 2019-11-12 14:51:23.661 27646-27646/? A/DEBUG: #19 pc 000000000056afe0 /system/lib64/libart.so (art\_quick\_generic\_jni\_trampoline+144) 2019-11-12 14:51:23.661 27646-27646/? A/DEBUG: #20 pc 0000000000561f88 /system/lib64/libart.so (art\_quick\_invoke\_stub+584) 2019-11-12 14:51:23.661 27646-27646/? A/DEBUG: #21 pc 00000000000d0140 /system/lib64/libart.so (art::ArtMethod::Invoke(art::Thread\*, unsigned int\*, unsigned int, art::JValue\*, char const\*)+200) 2019-11-12 14:51:23.661 27646-27646/? A/DEBUG: #22 pc 00000000002865e8 /system/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread\*, art::ArtMethod\*, art::ShadowFrame\*, unsigned short, art::JValue\*)+344) 2019-11-12 14:51:23.661 3907-16246/? D/ConnectivityService: filterNetworkStateForUid() uid: 10864, pid: 26953 2019-11-12 14:51:23.661 27646-27646/? A/DEBUG: #23 pc 00000000002805a4 /system/lib64/libart.so (bool art::interpreter::DoCall\<false, false\>(art::ArtMethod\*, art::Thread\*, art::ShadowFrame&, art::Instruction const\*, unsigned short, art::JValue\*)+948)

Zip plugin test was done. It works well.

But it doesn’t work on my project.

So I resolved through the native features.

Thank you.

This is weird. Thanks for helping out. Glad you figured it out.