M megzz Member Licensed User Longtime User Nov 4, 2017 #1 I want to open an activity twice. I will duplicate it and repaet again. How did it do it ? Code: Copy Dim nactivity As Activity nactivity.Initialize("nactivity") nactivity = main ' Active activity StartActivity(nactivity)
I want to open an activity twice. I will duplicate it and repaet again. How did it do it ? Code: Copy Dim nactivity As Activity nactivity.Initialize("nactivity") nactivity = main ' Active activity StartActivity(nactivity)
DonManfred Expert Licensed User Longtime User Nov 4, 2017 #2 You can not Declare a New Activity by Code or to get. Each Activity is a Module in your Project. You are free to init, load the content in the new activity the same way as you did in the other one. Duplicating the code from the activity. Upvote 0
You can not Declare a New Activity by Code or to get. Each Activity is a Module in your Project. You are free to init, load the content in the new activity the same way as you did in the other one. Duplicating the code from the activity.
M megzz Member Licensed User Longtime User Nov 4, 2017 #3 DonManfred said: You can not Declare a New Activity by Code or to get. Each Activity is a Module in your Project. You are free to init, load the content in the new activity the same way as you did in the other one. Duplicating the code from the activity. Click to expand... If this is possible it'll be very good. Can you please give a sample code to me for b4a? Upvote 0
DonManfred said: You can not Declare a New Activity by Code or to get. Each Activity is a Module in your Project. You are free to init, load the content in the new activity the same way as you did in the other one. Duplicating the code from the activity. Click to expand... If this is possible it'll be very good. Can you please give a sample code to me for b4a?
DonManfred Expert Licensed User Longtime User Nov 4, 2017 #4 You already have the code in your 1st activity. If you want the second activity the same then add the code you used in Activity 1 also in the other one. https://www.b4x.com/android/forum/threads/two-activities-example.6611/#content Upvote 0
You already have the code in your 1st activity. If you want the second activity the same then add the code you used in Activity 1 also in the other one. https://www.b4x.com/android/forum/threads/two-activities-example.6611/#content
klaus Expert Licensed User Longtime User Nov 4, 2017 #5 Sorry, but I don't understand why you want to run a same Activity twice? Why not using the same? Upvote 0
tigrot Well-Known Member Licensed User Longtime User Nov 4, 2017 #6 klaus said: Why not using the same? Click to expand... I agree with klaus. First an Activity can be run only once in process and also in case it could be possible Android only keeps an Activity "active" at a time on whole system. Upvote 0
klaus said: Why not using the same? Click to expand... I agree with klaus. First an Activity can be run only once in process and also in case it could be possible Android only keeps an Activity "active" at a time on whole system.