- Forum posts: 2
Jun 13, 2016, 2:56:24 AM via Website
Jun 13, 2016 2:56:24 AM via Website
im trying to make a function to make directing with intent more smooth.
so instead of this
[code]
public void gotoPage(View view){
Intent intent = new Intent(this, MainActivity.class);
startActivity(intent);
[/code]
i want it something like this
protected void gotopg(String tgtlnk){
Intent intent = new Intent(this, MainActivity.class);
startActivity(intent);
}
calling this way....gotopg(MainActivity) so when i call it its a simply 1 line to go to another activity.
I am new to this and java was never my strong suit but i do have php experience.
i want to be able to call this function send a variable which would be the target to go to.
i also dont understand why there is a View view. could someone elaborate this a bit more. im really confused.