So something like this, but it doesn't show my activity.
B4X:
Dim Intent1 As Intent
Intent1.Initialize(Intent1.ACTION_MAIN, "")
Intent1.SetComponent("com.rootsoft.viewcontainer.HomeActivity")
StartActivity(Intent1)
android.content.ActivityNotFoundException: Unable to find explicit activity class {com.rootsoft.viewcontainer/com.rootsoft.viewcontainer.HomeActivity}; have you declared this activity in your AndroidManifest.xml?
I did not declare the activity in the editor.
You should know that i need to start a Basic4Android activity from an intent and not from a library. (so we don't need to declare the activity in the manifest.(?))
However, after some debugging with Martin, it seemed that the packagename + class should have been lowercased:
B4X:
Dim Intent1 As Intent
'Intent1.Initialize("", "")
Intent1.Initialize(Intent1.ACTION_MAIN, "")
Intent1.SetComponent("com.rootsoft.viewcontainer/.topact")
Probably because due compiling the classnames get lowercased, which now seems to work.
Well, that was my problem.
I had to use an intent to start my activity.
I'm using the following code to start an activity and embed it in a view.
This way, it will be easier to create native StandOut apps by creating the activities instead of manually.
B4X:
/**
* Loads an activity in a window.
*/
public View LoadActivityInWindow(String uniqueID, IntentWrapper i) {
android.view.Window w = mgr.startActivity(uniqueID, i.getObject());
View wd = w != null ? w.getDecorView() : null;
return wd;
}
B4X:
Sub mnuIntent_Click
Dim Intent1 As Intent
Intent1.Initialize(Intent1.ACTION_MAIN, "")
Intent1.SetComponent("com.rootsoft.viewcontainer/.topact")
Dim v As View
v = window.LoadActivityInWindow(1, Intent1)
Panel1.AddView(v, 0dip, 0dip, Panel1.Width, Panel1.Height)
End Sub
As you can see, i needed an intent to start the activity.