我正在尝试运行HelloWebView示例(不做任何自定义),该示例可在以下位置找到:
http://developer.android.com/resources/tutorials/views/hello-webview.html
我一直遇到java.lang.SecurityException:Permission Denial的问题,尽管已经做了所有努力。在我看来,这必须是我自己的一些基本理解上的缺陷(我是新手),或者可能是我的开发环境(Windows XP)的本地问题。我在下面包含了我的main.xml、AndroidManifest.xml和控制台输出。
迄今为止尝试的事情:
- 不同的api(6,7) - 添加/验证(我认为:)“uses-permission android:name="android.permission.INTERNET"”在我的清单中具有正确的语法和位置。 - 清除模拟器 - 重新启动eclipse、笔记本电脑等 - 禁用我的互联网安全
非常感谢您提供任何帮助。
谢谢。 Tim
我的主xml是:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<WebView
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
</LinearLayout>
我的清单文件是:
<uses-permission android:name="android.permission.INTERNET" />
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".HelloWebView"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".HelloWebView" android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar">
</activity>
</application>
实际控制台输出:
------------------------------ [2010-06-04 07:57:06 - HelloWebView] Android启动! [2010-06-04 07:57:06 - HelloWebView] adb正常运行。 [2010-06-04 07:57:06 - HelloWebView] 执行com.example.hellowebview.HelloWebView活动启动。 [2010-06-04 07:57:06 - HelloWebView] 自动目标模式:使用兼容AVD“AndroidGM2.1”启动新仿真器。 [2010-06-04 07:57:06 - HelloWebView] 使用虚拟设备“AndroidGM2.1”启动新仿真器。 [2010-06-04 07:57:08 - HelloWebView] 发现新的仿真器:emulator-5554 [2010-06-04 07:57:08 - HelloWebView] 等待HOME('android.process.acore')启动... [2010-06-04 07:57:34 - HelloWebView] 警告:应用程序未指定API级别要求! [2010-06-04 07:57:34 - HelloWebView] 设备API版本为7(Android 2.1) [2010-06-04 07:57:34 - HelloWebView] HOME已在设备'emulator-5554'上启动 [2010-06-04 07:57:34 - HelloWebView] 正在将HelloWebView.apk上传到设备'emulator-5554' [2010-06-04 07:57:35 - HelloWebView] 正在安装HelloWebView.apk... [2010-06-04 07:57:46 - HelloWebView] 成功! [2010-06-04 07:57:47 - HelloWebView] 在设备上启动com.example.hellowebview.HelloWebView活动 [2010-06-04 07:57:55 - HelloWebView] ActivityManager:正在启动:Intent { act = android.intent.action.MAIN cat = [android.intent.category.LAUNCHER] cmp = com.example.hellowebview / .HelloWebView } [2010-06-04 07:57:55 - HelloWebView] ActivityManager:java.lang.SecurityException:权限拒绝:从null(pid = -1,uid = -1)需要null启动Intent { act = android.intent.action.MAIN cat = [android.intent.category.LAUNCHER] flg = 0x10000000 cmp = com.example.hellowebview / .HelloWebView }