当前位置:操作系统 > 安卓/Android >>

Android开发相关:(08)系统预制的应用程序

[java] public class IntentsUtils  

    public static void invokeBasicActivity(Activity activity) 
    { 
           String actionName= "com.androidbook.intent.action.ShowBasicView"; 
           Intent intent = new Intent(actionName); 
           activity.startActivity(intent); 
    } 
    public static void invokeWebBrowser(Activity activity) 
    { 
        Intent intent = new Intent(Intent.ACTION_VIEW); 
        intent.setData(Uri.parse("http://www.zzzyk.com")); 
        activity.startActivity(intent); 
    } 
    public static void invokeWebSearch(Activity activity) 
    { 
        Intent intent = new Intent(Intent.ACTION_WEB_SEARCH); 
        intent.setData(Uri.parse("http://www.zzzyk.com")); 
        activity.startActivity(intent); 
    } 
    public static void dial(Activity activity) 
    { 
        Intent intent = new Intent(Intent.ACTION_DIAL); 
        activity.startActivity(intent); 
    } 
     
    public static void call(Activity activity) 
    { 
        Intent intent = new Intent(Intent.ACTION_CALL); 
        intent.setData(Uri.parse("tel:904-905-5646")); 
        activity.startActivity(intent); 
    } 
    public static void showMapAtLatLong(Activity activity)  
    { 
        Intent intent = new Intent(Intent.ACTION_VIEW); 
        //geo:lat,long?z=zoomlevel&q=question-string  
        intent.setData(Uri.parse("geo:0,0?z=4&q=business+near+city")); 
        activity.startActivity(intent); 
    } 
        public static void tryOneOfThese(Activity activity) 
        { 
            IntentsUtils.call(activity); 
        } 




摘自 horsttnann的专栏

补充:移动开发 , Android ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,