Android 獲取當前連線 Cid和lac
阿新 • • 發佈:2019-02-05
mPhoneStateReceiver =newPhoneStateIntentReceiver(this,newServiceStateHandler());
mPhoneStateReceiver.notifyServiceState(MY_NOTIFICATION_ID);
mPhoneStateReceiver.notifyPhoneCallState(MY_NOTIFICATION_ID);
mPhoneStateReceiver.notifySignalStrength(MY_NOTIFICATION_ID);
mPhoneStateReceiver.registerIntent(); privateclassServiceStateHandlerextendsHandler{publicvoid handleMessage(Message msg){switch(msg.what){case MY_NOTIFICATION_ID:ServiceState state = mPhoneStateReceiver.getServiceState();System.out.println(state.getCid());System.out.println(state.getLac());System.out.println(mPhoneStateReceiver.getSignalStrength ());break;}}}