通过调用系统的PhoneNumberFormattingTextWatcher类来实现
`
import android.annotation.SuppressLint;
import android.content.Context;
import android.os.AsyncTask;
import android.telephony.PhoneNumberFormattingTextWatcher;
import android.widget.TextView;
/**
* 自动为手机号添加分割符
* [@author](http://my.oschina.net/arthor) longpc
*
*/
public final class PhoneNumberFormatter {
private PhoneNumberFormatter() {}
/**
* Load {[@link](http://my.oschina.net/u/393) TextWatcherLoadAsyncTask} in a worker thread and set it to a {[@link](http://my.oschina.net/u/393) TextView}.
*/
private static class TextWatcherLoadAsyncTask extends
AsyncTask {
private final TextView mTextView;
public TextWatcherLoadAsyncTask(TextView textView) {
mTextView = textView;