安卓常用功能——已封装好
生活随笔
收集整理的這篇文章主要介紹了
安卓常用功能——已封装好
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
//彈出框public void totast(String text) {Toast.makeText(getApplicationContext(), text,Toast.LENGTH_SHORT).show();}//瀏覽器打開網址private void open_url(String sUrl) {Intent intent = new Intent();intent.setData(Uri.parse(sUrl));intent.setAction(Intent.ACTION_VIEW);startActivity(intent);//打開瀏覽器
}//撥打電話private void bohao(String number) {//直接撥打電話Intent intent = new Intent(Intent.ACTION_CALL,Uri.parse("tel:"+number));//跳轉到撥號界面//Intent intent = new Intent(Intent.ACTION_DIAL,Uri.parse("tel:"+number));
startActivity(intent); }//調用默認地圖應用private void ditu() {Uri uri = Uri.parse("geo:38.899533,-77.036476");Intent intent = new Intent(Intent.ACTION_VIEW, uri); startActivity(intent); }//路線規劃private void luxian() {Uri uri = Uri.parse("http://maps.google.com/maps?f=d&saddr=startLat%20startLng&daddr=endLat%20endLng&hl=en");Intent intent = new Intent(Intent.ACTION_VIEW, uri);startActivity(intent);}
?
轉載于:https://www.cnblogs.com/xiongwei89/p/3425618.html
總結
以上是生活随笔為你收集整理的安卓常用功能——已封装好的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: C# Enum,Int,String的互
- 下一篇: Android 观察系统中短信内容的变化