[英]phone link not working in the android APP
你好,我在我的網站<a href='tel: 123456789'>1234</a>
有此鏈接,並且我正在將網站轉換為android APP,一切正常,但是此tel鏈接使我webpage not available
該webpage not available
撥打電話,而不是將其視為android應用中的鏈接。
我已經添加了
<uses-permission android:name="android.permission.CALL_PHONE" />
我不知道如何解決此鏈接問題,我應該使用任何JavaScript或其他工具嗎?
據我了解,您想在有人點擊時撥打該號碼,您可以使用以下代碼:
String uri = "tel:" + "NUMBER-GOES-HERE" ;
Intent intent = new Intent(Intent.ACTION_CALL);
intent.setData(Uri.parse(uri));
startActivity(intent);
不要忘記在<application />
標記之前添加權限:
<uses-permission android:name="android.permission.CALL_PHONE" />
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.