zoukankan      html  css  js  c++  java
  • 安卓常用功能——已封装好

    //弹出框
        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);
    
        }
  • 相关阅读:
    搜索算法总结
    浅谈cocosd之autorelease etain elease的理解
    lua和C++的交互(1)
    Unity相对于Cocos2d-x的比较
    Lua弱表Weak table
    socket编程学习step2
    ppt述职摘要
    LuaJavaBridge
    鱼书学习小结(一)
    网络协议HTTP TCP/UDP 浏览器缓存 Restful(十)
  • 原文地址:https://www.cnblogs.com/xiongwei89/p/3425618.html
Copyright © 2011-2022 走看看