Can no longer create activities

MrKim

Well-Known Member
Licensed User
Longtime User
I have a small project with two activities and two service modules. I added a third Activity and I get this error:

android.content.ActivityNotFoundException: Unable to find explicit activity class {simple.software.nag/simple.software.nag.stopnagging}; have you declared this activity in your AndroidManifest.xml?

I have deleted and recreated the the Activity, tried a different name, tried opening it from an event and a simple button. Cleaned the project and rebooted the computer, tried different Emulators and a real phone, all with the same result. I cannot add a new Activity without this error, the two exisiting Activities continue to work fine.

What am I missing?

The line to open the Activity is:

StartActivity ("StopNagging")

Note that the working activity contains the EXACT SAME code and works fine. When I couldn't get this to work I duplicated the code from a working activity. Still didn't work.
code is below.

Thanks for your help:sign0104:
 
Last edited:

MrKim

Well-Known Member
Licensed User
Longtime User
'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub

Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim SMStxt As EditText
End Sub

Sub Activity_Create(FirstTime As Boolean)
Log("Activity_Resume")
'ListenForMessages.Timer1.enabled=False
'ListenForMessages.Smgr.setboolean("UsrIntervened",True)
Activity.LoadLayout("ShowSMS")
SMStxt.Text=CheckSMS.Mtxt


End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub
 
Upvote 0

mc73

Well-Known Member
Licensed User
Longtime User
I don't know the reason of this error, but perhaps you could try loading the activity using its object instead of string declaration, as follows:
B4X:
StartActivity (StopNagging)
 
Upvote 0

MrKim

Well-Known Member
Licensed User
Longtime User
Solved it!

Sigh, solved it. Somewhere along the line the

"Project>Do not overwrite Manifest File"

toggle got checked. The joys of learning a new environment.

If I had just looked at the compile log in the first place I would have saved myself several hours of frustraion.

MC73, thanks, forgot to mention I tried it both ways.
 
Last edited:
Upvote 0
Top