How can I create new instance of an activity ? I want to create new activity of act2 and again when I clicked the activity again new instance of this activity create.
its my code but it not works
B4X:
Sub Activity_Click
Dim Intent1 As Intent
Intent1.Initialize("", "")
Intent1.SetComponent(Application.PackageName & "/.act2")
Intent1.PutExtra("key", Rnd(1,1000000))
StartActivity(Intent1)
End Sub
thanks Erel , but I would like to create new instance of activity every time when I click on it ( just in this case only ) please have a look at this video :
in telegram when we click on any channel name , the telegram makes new activity for it again ,I want do exactly same action in my application ( it is a social networking app )
Thank you Erel but when I touch back key the activity ( act2 ) destroyed , this is not my expectation.Assuming you clicked several times on a button , every time when you clicked on it must new activity ( act2 ) to be display and when the user click on back key the last activity ( of act2 ) finish but one before the last show again ( Exactly like the videos I showed )
workaround
how about to change the content from the activity.
instead of 100 activitys - 100 CustomViews inside and make this visible that user will see.
Assuming you clicked several times on a button , every time when you clicked on it must new activity ( act2 ) to be display and when the user click on back key the last activity ( of act2 ) finish but one before the last show again ( Exactly like the videos I showed )