android.content.ActivityNotFoundException: Unable to find explicit activity class {b4a.example/com.wmspanel.streamer.ConnectionWizard}; have you declared this activity in your AndroidManifest.xml?
The complete trace
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
android.content.ActivityNotFoundException: Unable to find explicit activity class {b4a.example/com.wmspanel.streamer.ConnectionWizard}; have you declared this activity in your AndroidManifest.xml?
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1815)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1649)
at android.app.Activity.startActivityForResult(Activity.java:5023)
at android.app.Activity.startActivityFromFragment(Activity.java:5009)
at android.app.Activity$HostCallbacks.onStartActivityFromFragment(Activity.java:7460)
at android.app.Fragment.startActivity(Fragment.java:1130)
at android.app.Fragment.startActivity(Fragment.java:1109)
at com.wmspanel.streamer.PreferenceFragmentConnectionManager$1.onPreferenceClick(PreferenceFragmentConnectionManager.java:36)
at android.preference.Preference.performClick(Preference.java:1185)
at android.preference.PreferenceScreen.onItemClick(PreferenceScreen.java:289)
at android.widget.AdapterView.performItemClick(AdapterView.java:339)
at android.widget.AbsListView.performItemClick(AbsListView.java:1695)
at android.widget.AbsListView$PerformClick.run(AbsListView.java:4171)
at android.widget.AbsListView$13.run(AbsListView.java:6772)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6692)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)
The error appear when i click on a preference-activity button which should open a Activity.
B4X:
private Preference.OnPreferenceClickListener mClickListener = new Preference.OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference pref) {
final String key = pref.getKey();
if (key == null) {
return false;
}
Log.d(TAG, key);
if (key.equals(KEY_ADD)) {
//Intent intent = new Intent(getActivity(), ConnectionWizard.class);
Intent intent = new Intent(getActivity(), ConnectionWizard.class);
startActivity(intent); ' java line 36
return true;
} else {
DataHolder.getInstance().save(DataHolder.EDITED_CONNECTION, key);
return false;
}
}
};
The Manifest looks like this
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="22"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
'End of default text.
AddManifestText( <uses-feature
android:name="android.hardware.camera"
android:required="false" />
<uses-feature
android:name="android.hardware.camera.autofocus"
android:required="false" />
<uses-feature
android:name="android.hardware.camera.front"
android:required="false" />
<uses-feature
android:name="android.hardware.camera.flash"
android:required="false" />
<uses-feature
android:name="android.hardware.camera2"
android:required="false" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.BROADCAST_STICKY" />
<uses-permission android:name="android.permission.BLUETOOTH" />
)
AddPermission(android.permission.INTERNET)
AddPermission(android.permission.CAMERA)
AddPermission(android.permission.RECORD_AUDIO)
AddPermission(android.permission.READ_EXTERNAL_STORAGE)
AddPermission(android.permission.WRITE_EXTERNAL_STORAGE)
AddPermission(android.permission.ACCESS_NETWORK_STATE)
AddPermission(android.permission.MODIFY_AUDIO_SETTINGS)
AddPermission(android.permission.BROADCAST_STICKY)
AddPermission(android.permission.BLUETOOTH)
AddApplicationText( <activity
android:name="com.wmspanel.streamer.MainActivityBase"
android:label="@string/app_name"
android:screenOrientation="landscape" />
<activity
android:name="com.wmspanel.streamer.MainActivityCamera2"
android:label="@string/app_name"
android:screenOrientation="landscape" />
<activity
android:name="com.wmspanel.streamer.MainActivityGLES"
android:configChanges="orientation|screenSize|keyboardHidden"
android:label="@string/app_name" />
<activity
android:name="com.wmspanel.streamer.SettingsActivity"
android:configChanges="orientation|screenSize|keyboardHidden"
android:label="@string/app_name" />
<activity
android:name="com.wmspanel.streamer.Connectionwizard"
android:configChanges="orientation|screenSize|keyboardHidden"
android:label="@string/app_name" />
<activity
android:name="com.wmspanel.streamer.MainActivityHorizon"
android:configChanges="orientation|screenSize|keyboardHidden"
android:label="@string/app_name" />
<!-- A simple directory chooser you can integrate into your Android app. -->
<!-- https://github.com/passy/Android-DirectoryChooser -->
<activity android:name="net.rdrei.android.dirchooser.DirectoryChooserActivity" />
)
Any hints what i have done wrong? Or any hint to fix it?