Home > Mobile >  Android null pointer problem, really can not find, ask bosses give directions
Android null pointer problem, really can not find, ask bosses give directions

Time:09-30












Was going to write a small android games of 2048, but encountered such a problem, find a few days all don't know where to free a pointer,, every brother please advice, I thank you enough

CodePudding user response:

You read the newspaper wrong log, trycach, explain you call empty attributes of the object, do you have a look at the object does not exist, or call a member of the class attribute doesn't exist, hope to help you

CodePudding user response:

Plus the log output, see is go step a null pointer

CodePudding user response:

The startGame 103 lines exist null Pointers, you post the code do not match your offer a firm one wrong trace, you look at the MainActivity. GetMainActivity () is null?

CodePudding user response:

You opened a confused, rows of not, please remove the confusion in the debug, remove the confusion: https://blog.csdn.net/weimingjue/article/details/84976058
Please look at the inside of the logcat log, this is not the whole, logcat will tell you which calls to empty,

If is the preview of the sidebar error please ignore temporarily,
If it is to run the code error, please check the MainActivity. GetMainActivity and cardsMap there will be a is null
  • Related