从oncreate方法中检索信号强度值

时间:2014-01-05 09:24:48

标签: android scope signal-strength

如何在Activity内的oncreate方法中检索strengthAmplitude的值。

 private class SignalStrengthListener extends PhoneStateListener
         {

     @Override

    public void onSignalStrengthsChanged(android.telephony.SignalStrengthsignalStrength) 
         {                        

             // get the signal strength (a value between 0 and 31)
             int strengthAmplitude = signalStrength.getGsmSignalStrength();


            super.onSignalStrengthsChanged(signalStrength);
          }
    }

0 个答案:

没有答案