java - setArguments(args) is not resolvable when I creating a MainActivity newInstance method in AndroidStudio -


i creating newinstance method under android's activity class.

however, not recognize setargument method accompanies fragment. have seen before?

private static final string arg_option = "argument_option";  public static mainactivity newinstance (int option){     mainactivity fragment = new mainactivity();     bundle args = new bundle();     args.putint(arg_option, option);     fragment.setargument(args);     return  fragment;  } 

you need use

fragment.setarguments(args); 

instead of

fragment.setargument(args); 

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -