HelloWebView样品:java.lang.SecurityException异常:拒绝权限 [英] HelloWebView Sample: java.lang.SecurityException: Permission Denial

查看:216
本文介绍了HelloWebView样品:java.lang.SecurityException异常:拒绝权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让HelloWebView样品和运行(这是,没有cuustomizations)在

发现

<一个href=\"http://developer.android.com/resources/tutorials/views/hello-webview.html\">http://developer.android.com/resources/tutorials/views/hello-webview.html

我继续得到java.lang.SecurityException异常:权限拒绝尽管所有的努力。在我心目中这一定是我的一部分了一些基本缺乏了解(我是新手)或什么地方也许我开发环境(Windows XP中)。

我已经包括了我的main.xml中,AndroidManifest.xml中,以下控制台输出。

东西试过到目前为止:


  • 不同的API(6,7)

  • 添加/验证(我认为:))说,使用许可权的android:NAME =android.permission.INTERNET对
    在我的清单正确的语法和位置。

  • 擦模拟器

  • 重新启动日食,笔记本电脑等。

  • 禁用我的互联网安全

任何帮助将大大AP preciated。

感谢您。
蒂姆·

我的主要XML是:

 &LT;?XML版本=1.0编码=UTF-8&GT?;
&LT; LinearLayout中的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
    机器人:方向=垂直
    机器人:layout_width =FILL_PARENT
    机器人:layout_height =FILL_PARENT
    &GT;
&LT;的WebView
    机器人:ID =@ + ID / web视图
    机器人:layout_width =FILL_PARENT
    机器人:layout_height =FILL_PARENT/&GT;
&LT; / LinearLayout中&GT;

我的清单文件是:


 &LT;使用许可权的android:NAME =android.permission.INTERNET对/&GT;&lt;应用机器人:图标=@绘制/图标机器人:标签=@字符串/ APP_NAME&GT;
    &LT;活动机器人:名字=。HelloWebView
              机器人:标签=@字符串/ APP_NAME&GT;
        &所述;意图滤光器&gt;
            &lt;作用机器人:名字=android.intent.action.MAIN/&GT;
            &LT;类机器人:名字=android.intent.category.LAUNCHER/&GT;
        &所述; /意图滤光器&gt;
    &LT; /活性GT;
    &LT;活动机器人:HelloWebViewNAME =机器人:标签=@字符串/ APP_NAME
 机器人:主题=@安卓风格/ Theme.NoTitleBar&GT;
    &LT; /活性GT;&LT; /用途&gt;

实际控制台输出:


 ------------------------------
[2010-06-04 7时57分06秒 - HelloWebView] Android的推出!
[2010-06-04 7时57分06秒 - HelloWebView]亚洲开发银行运行正常。
[2010-06-04 7时57分06秒 - HelloWebView]执行com.example.hellowebview.HelloWebView活动启动
[2010-06-04 7时57分06秒 - HelloWebView]自动目标模式:推出新的仿真器兼容AVDAndroidGM2.1
[2010-06-04 7时57分06秒 - HelloWebView]启动一个新的仿真与虚拟设备AndroidGM2.1
[2010-06-04 7时57分08秒 - HelloWebView]研究发现新的模拟器:模拟器-5554
[2010-06-04 7时57分08秒 - HelloWebView]等待HOME('android.process.acore')即将推出...
[2010-06-04 7时57分34秒 - HelloWebView]警告:应用程序没有指定的API等级要求!
[2010-06-04 7时57分34秒 - HelloWebView]设备API版本是7(Android 2.1的)
[2010-06-04 7时57分34秒 - HelloWebView] HOME高达设备'模拟器-5554
[2010-06-04 7时57分34秒 - HelloWebView]上传HelloWebView.apk到设备'模拟器-5554
[2010-06-04 7时57分35秒 - HelloWebView]安装HelloWebView.apk ...
[2010-06-04 7时57分46秒 - HelloWebView]成功!
[2010-06-04 7时57分47秒 - HelloWebView]在设备上启动活动com.example.hellowebview.HelloWebView
[2010-06-04 7时57分55秒 - HelloWebView] ActivityManager:开始:意向{行动= android.intent.action.MAIN猫= [android.intent.category.LAUNCHER] CMP = com.example.hellowebview / .HelloWebView }
[2010-06-04 7时57分55秒 - HelloWebView] ActivityManager:java.lang.SecurityException异常:权限拒绝:启动意向{行动= android.intent.action.MAIN猫= [android.intent.category.LAUNCHER] FLG = 0x10000000处CMP = com.example.hellowebview / .HelloWebView}从零(PID = -1,UID = -1)需要空


解决方案

您在你的清单文件中的两个条目为您HelloWebView活动。尝试删除第二个。

I am trying to get the HelloWebView Sample up and running (as is, with no cuustomizations) found at

http://developer.android.com/resources/tutorials/views/hello-webview.html

I continue to get java.lang.SecurityException: Permission Denial despite all efforts. In my mind this has got to be some fundamental lack of understanding on my part (I am a newbie) or something perhaps local to my development environment (Windows XP).

I have included my main.xml, AndroidManifest.xml, and console output below.

Things tried so far:

  • different api's (6,7)
  • adding/verifying (I think :)) that "uses-permission android:name="android.permission.INTERNET"" has the correct syntax and location in my manifest.
  • wiping emulator
  • restarting eclipse, laptop etc.
  • disabling my internet security

Any help would be greatly appreciated.

Thank you. Tim

my main xml is:

<?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> 

my manifest file is:

<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>

Actual console output:

 ------------------------------
[2010-06-04 07:57:06 - HelloWebView] Android Launch!
[2010-06-04 07:57:06 - HelloWebView] adb is running normally.
[2010-06-04 07:57:06 - HelloWebView] Performing com.example.hellowebview.HelloWebView activity launch
[2010-06-04 07:57:06 - HelloWebView] Automatic Target Mode: launching new emulator with compatible AVD 'AndroidGM2.1'
[2010-06-04 07:57:06 - HelloWebView] Launching a new emulator with Virtual Device 'AndroidGM2.1'
[2010-06-04 07:57:08 - HelloWebView] New emulator found: emulator-5554
[2010-06-04 07:57:08 - HelloWebView] Waiting for HOME ('android.process.acore') to be launched...
[2010-06-04 07:57:34 - HelloWebView] WARNING: Application does not specify an API level requirement!
[2010-06-04 07:57:34 - HelloWebView] Device API version is 7 (Android 2.1)
[2010-06-04 07:57:34 - HelloWebView] HOME is up on device 'emulator-5554'
[2010-06-04 07:57:34 - HelloWebView] Uploading HelloWebView.apk onto device 'emulator-5554'
[2010-06-04 07:57:35 - HelloWebView] Installing HelloWebView.apk...
[2010-06-04 07:57:46 - HelloWebView] Success!
[2010-06-04 07:57:47 - HelloWebView] Starting activity com.example.hellowebview.HelloWebView on device 
[2010-06-04 07:57:55 - HelloWebView] ActivityManager: Starting: 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: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.example.hellowebview/.HelloWebView } from null (pid=-1, uid=-1) requires null

解决方案

You have two entries in your manifest file for your HelloWebView activity. Try removing the second.

这篇关于HelloWebView样品:java.lang.SecurityException异常:拒绝权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆