Android开发中遇到的一些小问题

来源:互联网 发布:像素软件招聘 编辑:程序博客网 时间:2024/05/18 05:44


1.使用intent上网报错:android.content.ActivityNotFoundException:No Activity found to handle Intent

Intent intent = newIntent(Intent.ACTION_VIEW);intent.setData(Uri.parse(“www.baidu.com”));startActivity(intent);</span>

无法打开相应链接。

经过搜索,发现如果是要访问“www.baidu.com”这样的网址或者纯文字时,会报ActivityNotFoundException错误。

此时需要设置如下属性,就可以正常跳转了:

intent.setClassName("com.android.browser","com.android.browser.BrowserActivity");

//此处指定系统自带浏览器包名和Activity名称.  


2.Failed to push selection: Read-only file system

cmd下进入sdk/platform-tools目录,然后键入如下指令:

adb.exe shellsumount -orw,remount rootfs /chmod 777 /mnt/sdcard


3.org.eclipse.swt.SWTException: “Widget is disposed”

cmd下进入eclipse目录,键入如下指令:

eclipse –clean

0 0
原创粉丝点击