分类: [Android]

android打电话接口、获取本机号码

打电话: 1 Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + "13333333333")); 获取本机号码: 12345 TelephonyManager tm = (TelephonyManager) this.getSystemService(Context.TELEPHONY_SERVICE);String deviceid = tm.getDeviceId();String tel = tm.getLine1Number(); //本机号码String imei =tm.getSimSerialNumber();String imsi =tm.getSubscriberId ......

Android判断Service是否运行

1234567891011121314 /*** 判断服务是否正在运行* @return*/public boolean isServiceWorked() {    ActivityManager myManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);    ArrayList runningService = (ArrayList) myManager.getRunningServices(Integer.MAX_VALUE);    for (int i = 0; i < runningService.size(); i++) {       &n ......

Android Service中弹出全局对话框

思考着用后台service来弹出对话框,于是在网上搜到了这样的一种方法: 1234567891011121314151617181920212223242526272829 View view = View.inflate(StatusBarService.this, R.layout.power_off_dialog, null);AlertDialog.Builder b = new AlertDialog.Builder(StatusBarService.this);b.setView(view);final AlertDialog d = b.create();d.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG); //系统中关机对话框就是这个属性//d.getWindow().s ......