Home » Android » java – Android studio: Warning while I try to move Class to another package

java – Android studio: Warning while I try to move Class to another package

Posted by: admin May 14, 2020 Leave a comment

Questions:

This is an error msg.

Method Object.toString(), 
referenced in method SettingActivity.saveDataButtons(), 
will not be accessible in module personal-health-assistant back up 29 oct  

Method String.trim(), 
referenced in method SettingActivity.setNullCurrentFocusedEditText(), 
will not be accessible in module personal-health-assistant back up 29 oct  

Method String.length(), 
referenced in method SettingActivity.setNullCurrentFocusedEditText(), 
will not be accessible in module personal-health-assistant back up 29 oct

I want to know

  1. How can this happen? Why are some methods cannot will not be accessible in module?
  2. Is it matter?
  3. How to solve this warning?
How to&Answers:

This warning is commonly emitted regarding inaccessible non-public methods (since moving it out of the package prevents other members of the initial package from accessing it).

However, since in your case SettingActivity is accessing quite common classes Object and String, and that too their public methods, it seems you are moving it to a package not hooked up to the SDK.

“personal-health-assistant back up 29 oct” might be configured with another SDK (non-Android)