S sareban Member Feb 25, 2021 #1 How can i start an activity that extends appcompatactivity in wrapper class I Add this in manifaest B4X: AddApplicationText( <activity android:name="com.hbisoft.hbrecorder.SettingsActivity"/> ) and used it in wrapper class Java: ba.activity.startActivity(new Intent(ba.context, SettingsActivity.class)); But B4X: java.lang.NullPointerException: Attempt to read from field 'android.app.Activity anywheresoftware.b4a.BA.activity' on a null object reference How can i fix it? Last edited: Feb 25, 2021
How can i start an activity that extends appcompatactivity in wrapper class I Add this in manifaest B4X: AddApplicationText( <activity android:name="com.hbisoft.hbrecorder.SettingsActivity"/> ) and used it in wrapper class Java: ba.activity.startActivity(new Intent(ba.context, SettingsActivity.class)); But B4X: java.lang.NullPointerException: Attempt to read from field 'android.app.Activity anywheresoftware.b4a.BA.activity' on a null object reference How can i fix it?
Erel B4X founder Staff member Licensed User Longtime User Feb 25, 2021 #2 1. Wrapping activities is a (big) mistake. You should instead implement a class with the needed features and use the #Extends attribute. 2. Using AppCompat is probably a mistake as well, as Android 4 devices are no longer relevant.
1. Wrapping activities is a (big) mistake. You should instead implement a class with the needed features and use the #Extends attribute. 2. Using AppCompat is probably a mistake as well, as Android 4 devices are no longer relevant.