Android Question Changing the start activity

JMB

Active Member
Licensed User
Longtime User
Hi there,

I have just spent a whole load of time creating an activity which now works nicely.

I now realise that rather than this being the Main activity that opens when the App is started, I want to be able to call it from another activity which will actually be the main activity.

How do I make the activity that I've created a sub activity to a new Main activity?

I hope this makes sense...

Thanks for your help.

JB
 

Peter Simpson

Expert
Licensed User
Longtime User
Copy the code from the main activity to your new activity, then do the following.

B4X:
'This code is in your Main Activity
Sub Activity_Create(FirstTime As Boolean)
    StartActivity(NewActivity)
    Activity.Finish
End Sub
 
Upvote 0

JMB

Active Member
Licensed User
Longtime User
Thanks for that, Peter.

I didn't think it would be quite as simple as that!

JB
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…