android - how to use variable while calling new activity in intent? -
I have code to call new activity
Now I call new activity variable I want to use
string var1, var2, var3; Var1 = "logged in"; Var2 = "registration"; Var3 = "more";
I intend; I = new intent (favorite. This, login class); - & gt; Login.class with var startActivity (i);
How can someone get me this?
You can not pass a string as a parameter because it is an activity.
If you have one or switch statement to switch between different selections.
Something like this might happen ....
I intend to; Switch (var) case: login i = new intent (favorite. This, login class); break; Case: Signup I = new intent (favorite. This, signup category); break; Case: More i = New Intent (favorite. This, More.class); break; StartActivity (i);
Comments
Post a Comment