0

我发现以下代码运行良好:

Intent intent = new Intent( Intent.ACTION_DIAL , Uri.parse("tel:555-2368") );

但是当我尝试下面的代码时,它不起作用。我正在尝试通过从文件中读取来创建 URI。

File f = new File ( "tushar.txt") ;
f.createNewFile() ;

fw = new FileWriter(f) ;
bfr = new BufferedWriter(fw);
bfr.write("9654309293") ;
bfr.write("9876543210") ;
Uri u = Uri.fromFile(f) ;

Intent intent =
new Intent(Intent.ACTION_DIAL, u);
4

1 回答 1

0

试试这个-

File f = new File ( "tushar.txt") ;
f.createNewFile() ;

fw = new FileWriter(f) ;
bfr = new BufferedWriter(fw);
bfr.write("tel:9654309293") ;
bfr.write("tel:9876543210") ;
bfr.flush();
fw.close();
Uri u = Uri.fromFile(f) ;

Intent intent =
new Intent(Intent.ACTION_DIAL, u);
于 2013-04-16T08:33:59.170 回答