import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.telephony.PhoneStateListener;
import android.telephony.SignalStrength;
import android.telephony.TelephonyManager;
import android.widget.TextView;
import android.widget.Toast;
public class GetGsmSignalStrength extends Activity
{
/*
* This variables need to be global, so we can used them onResume and
* onPause method to
*
* stop the listener
*/
TelephonyManager Tel;
MyPhoneStateListener MyListener;
TextView tv;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
tv = (TextView) findViewById(R.id.tv);
/* Update the listener, and start it */
MyListener = new MyPhoneStateListener();
Tel = (TelephonyManager) getSystemServic
Android:TelephonyManager,MyPhoneStateListener监听手机信号强度
最新推荐文章于 2021-05-26 08:31:35 发布