Search code examples
javaconstructorvisible

Constructor SignalStrength() is not visible? What to do?


Yesterday i tried to create an object for this class to be able to use its methods getGsmBitErrorRate() and getGsmSignalStrength(), but Eclipse IDE throws me error that constructor is not visible. The line:

SignalStrength x = new SignalStrength();

Target SDK set in manifest file is 7. Any ideas what can be done to solve this problem?

Sorry, i forgot to mention that the programming language is Java and I am trying to make an app for Android.


Solution

  • Assuming you're talking about the Android SignalStrength class there aren't any public constructors as far as I can see. You need to get a reference to an instance from somewhere else - such as by overriding onSignalStrenthsChanged in PhoneStateListener.