安卓常用功能——已封装好
生活随笔
收集整理的這篇文章主要介紹了
安卓常用功能——已封装好
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
//彈出框public void totast(String text) {Toast.makeText(getApplicationContext(), text,Toast.LENGTH_SHORT).show();}//瀏覽器打開網(wǎng)址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));//跳轉(zhuǎn)到撥號界面//Intent intent = new Intent(Intent.ACTION_DIAL,Uri.parse("tel:"+number));
startActivity(intent); }//調(diào)用默認(rèn)地圖應(yīng)用private void ditu() {Uri uri = Uri.parse("geo:38.899533,-77.036476");Intent intent = new Intent(Intent.ACTION_VIEW, uri); startActivity(intent); }//路線規(guī)劃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);}
?
轉(zhuǎn)載于:https://www.cnblogs.com/xiongwei89/p/3425618.html
總結(jié)
以上是生活随笔為你收集整理的安卓常用功能——已封装好的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: C# Enum,Int,String的互
- 下一篇: 编写高质量的Objective-C代码