Cannot make a static reference to the non-static method setClass (Context, Class ) from the type Intent MainActivity.java / yany / src / com / example / yany line 37 Java Problem
This is the error reporting
------ Solution ------------------------------------ --------
intent.setClass (MainActivity.this, other.class); intent is lowercase
------ Solution ------ --------------------------------------
intent.setClass (MainActivity.this, other . class); intent is lowercase
landlord careless little , IDE will tell you that the line in question , ah , and then look carefully , you can certainly find it
------ Solution --------- -----------------------------------
i sentence simple words , start (new intent (XXX.this, XXX.Class));
------ eference ----------------------------- ----------
This is the code
------ eference ------------------------------------ ---
LS positive solution you put the name of the object class name written
------ eference ---------------------- -----------------
Object name wrong
------ eference ------------------------------- --------
2 floor immediately solved ~ ~ ~ ~
------ eference - --------------------------------------
Intent is a class ah ! You have to instantiate an object before you can call the relevant methods ah ! So you should be changed to lowercase Intent that the intent
------ eference ----------------------------- ----------
upstairs with their answers
------ eference --------------------- ------------------
2L look great.
没有评论:
发表评论