1. *** New version of B4J is available ***
    B4J v7.8
    Dismiss Notice

Android Question start activity from the same activity

Discussion in 'Android Questions' started by Roberto P., Mar 28, 2015.

  1. Roberto P.

    Roberto P. Well-Known Member Licensed 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
     
  2. warwound

    warwound Expert Licensed User

    thedesolatesoul likes this.
  3. Erel

    Erel Administrator Staff Member Licensed User

    Have you tried to call Activity.Finish followed by StartActivity(Me)?
     
    MarkusR likes this.
  4. warwound

    warwound Expert Licensed User

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

    Code:
    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.
     
    lemonisdead, Roberto P. and Erel like this.
  5. Roberto P.

    Roberto P. Well-Known Member Licensed User

    Hi warwound,
    thanks, recreate native working properly. how can I call the recreated passing a parameter similar to callsub2 or callsub3?
    greetings
     
  6. warwound

    warwound Expert Licensed User

    I think you'll need to use Process Globals to store values that the recreated activity will read.
     
  7. Roberto P.

    Roberto P. Well-Known Member Licensed User

    ok, thanks for the advice
    best regards
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice