forked from Blankj/AndroidUtilCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPinyinActivity.java
More file actions
34 lines (27 loc) · 1012 Bytes
/
PinyinActivity.java
File metadata and controls
34 lines (27 loc) · 1012 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package com.blankj.androidutilcode.activity;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
import com.blankj.androidutilcode.R;
import com.blankj.utilcode.util.PinyinUtils;
/**
* <pre>
* author: Blankj
* blog : http://blankj.com
* time : 17/02/01
* desc : Pinyin工具类Demo
* </pre>
*/
public class PinyinActivity extends Activity {
private TextView tvAboutPinyin;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_pinyin);
tvAboutPinyin = (TextView) findViewById(R.id.tv_about_pinyin);
tvAboutPinyin.setText("测试拼音工具类"
+ "\n转拼音: " + PinyinUtils.ccs2Pinyin("测试拼音工具类", " ")
+ "\n获取首字母: " + PinyinUtils.getPinyinFirstLetters("测试拼音工具类", " ")
+ "\n澹台: " + PinyinUtils.getSurnamePinyin("澹台"));
}
}