首页 > 代码库 > android--手机桌面增加网址链接图标(解决方案)
android--手机桌面增加网址链接图标(解决方案)
这种做法最普遍最简单:
1、新建一个android空项目;
2、在drawable目录下添加图标文件,如icon.png;在values目录下的strings.xml文件中增加名称,如websitename。
3、在配置文件AndroidManifest.xml中,增加链接的图标icon和名称websitename:
<application android:label="@string/name" android:icon="@drawable/icon">4、在MainActivity中编辑onCreate方法:
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Uri uri = Uri.parse("http://blog.csdn.net/wanggsx918"); Intent it = new Intent(Intent.ACTION_VIEW, uri); startActivity(it); finish(); }
没错,就是这么简单!
如果想做得更好,就在应用中增加webview浏览器功能。
android--手机桌面增加网址链接图标(解决方案)
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。