我正在尝试使用ez vcard库读取vcf文件并在文本视图中显示所有姓名和电话号码这是我的代码
try{
File file = new File(Environment.getExternalStorageDirectory()+"/mark/Contact/a.vcf");
List<VCard> vcards = Ezvcard.parse(file).all();
for (VCard vcard : vcards){
String name = vcard.getFormattedName().getValue();
for (Telephone tel : vcard.getTelephoneNumbers()){
System.out.println(tel.getTypes() + ": " + tel.getText());
TextView tv1 =(TextView) findViewById(R.id.tv1);
tv1.setMovementMethod(new ScrollingMovementMethod());
tv1.setText(name);
}}
}catch(Exception e){e.printStackTrace();}