//获取要加密手机号得ID
TextView phone_id = findViewById(R.id.phone_id);
//得到ID得值
String phone_text = phone_id.getText().toString().trim();
//进行加密
String phone = phone_text.substring(0,3)+"****"+phone_text.substring(7,phone_text.length());
//设置加密后得值
phone_id.setText(phone);
此时phone_id 就是加密后得值