Android Question start activity from the same activity

Roberto P.

Well-Known Member
Licensed User
Longtime User
I have to run from one activity (with a callsub) the same activity (with different parameters), but I see that you can not ?! how can I solve this need \ limit?

in other words

I have the Task activity, with the Open function (id as int)
from the same activity I throw the same with a different parameter to open another task


thank you
 

warwound

Expert
Licensed User
Longtime User
Here's some working code you can add to any activity and then be able to recreate it:

B4X:
Sub RecreateActivity
	Log("RecreateActivity called")
	Dim JavaObject1 As JavaObject
	JavaObject1.InitializeContext
	JavaObject1.RunMethod("NativeRecreateActivity", Null)
End Sub

#If JAVA
public void NativeRecreateActivity(){
	this.recreate();
}
#End If

Martin.
 
Upvote 0

Roberto P.

Well-Known Member
Licensed User
Longtime User
Hi warwound,
thanks, recreate native working properly. how can I call the recreated passing a parameter similar to callsub2 or callsub3?
greetings
 
Upvote 0

warwound

Expert
Licensed User
Longtime User
I think you'll need to use Process Globals to store values that the recreated activity will read.
 
Upvote 0

Roberto P.

Well-Known Member
Licensed User
Longtime User
ok, thanks for the advice
best regards
 
Upvote 0
Top