Android WebVIew 加載頁面失敗

 新手練習,今天學習並嘗試了用WebView 加載一個url,但試驗了幾遍都不能成功加載,提示 「找不到頁面」, 看了看書上的代碼,沒什麼異樣,糾結。百度了一下也沒有發現相關問題, 因而下載了源碼,導入,翻了飯源碼,和相關配置文件,終於發如今AndroidManifest.xml中多了一句 權限設置, 因此,修改AndroidManifest.xml,新增一個INTERNET權限便可解決問題,配置以下android

  
  
  
  
  1. <manifest xmlns:android="http://schemas.android.com/apk/res/android" 
  2.     package="com.sdvdxl.webview" 
  3.     android:versionCode="1" 
  4.     android:versionName="1.0" > 
  5.  
  6.     <uses-sdk 
  7.         android:minSdkVersion="8" 
  8.         android:targetSdkVersion="15" /> 

  9. <!--添加以下一句-->
  10.     <uses-permission android:name="android.permission.INTERNET"></uses-permission> 
  11.     <application 
  12.         android:icon="@drawable/ic_launcher" 
  13.         android:label="@string/app_name"> 
  14.         <activity 
  15.             android:name=".MainActivity" 
  16.             android:label="@string/title_activity_main" > 
  17.             <intent-filter> 
  18.                 <action android:name="android.intent.action.MAIN" /> 
  19.  
  20.                 <category android:name="android.intent.category.LAUNCHER" /> 
  21.             </intent-filter> 
  22.         </activity> 
  23.          
  24.     </application> 
  25.      
  26. </manifest> 

沒什麼技術含量,只爲記錄學習過程當中遇到的問題,可能會幫到其他的新手。web

相關文章
相關標籤/搜索