아래 코드를 사용하여이 Url을로드해야합니다. 마지막으로 빈 화면이 출력으로 표시됩니다. last line
에있는 코드간에 url
링크를 확인할 수 있습니다.webView.loadUrl은 빈 화면을 표시합니다.
WebPagerLoader.java :
public class WebPageLoader extends Activity
{
final Activity activity = this;
private String html;
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
this.getWindow().requestFeature(Window.FEATURE_PROGRESS);
setContentView(R.layout.activity_main);
WebView webView = (WebView) findViewById(R.id.webview);
webView.getSettings().setJavaScriptEnabled(true);
webView.setWebChromeClient(new WebChromeClient() {
public void onProgressChanged(WebView view, int progress)
{
activity.setTitle("Loading...");
activity.setProgress(progress * 100);
if(progress == 100)
activity.setTitle(R.string.app_name);
}
});
webView.setWebViewClient(new WebViewClient() {
@Override
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl)
{
}
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url)
{
view.loadUrl(url);
return true;
}
});
webView.loadUrl("<iframe src=\"http://files.flipsnack.com/iframe/embed.html?hash=fdk843nc&wmode=window&bgcolor=EEEEEE&t=1381431045\" width=\"640\" height=\"385\" seamless=\"seamless\" scrolling=\"no\" frameborder=\"0\" allowtransparency=\"true\"></iframe>";
}
}
매니페스트 :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.webpageloader"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.webpageloader.WebPageLoader"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
마침내 나는 blank screen
.I 내가 wrong in webView.loadUrl
무엇을했는지 알 수 없습니다 얻을. 나는 이것들을 해결하는 방법을 모른다. 아무도이 문제를 도와 줄 수 없다. 감사합니다.
하는 STR = http://files.flipsnack.com/iframe/embed.html?hash=fdk843nc&wmode=window&bgcolor=EEEEEE&t=1381431045%22%20width=%22640%22%20height=%22385%22%'사용해보십시오 20seamless = % 22sexy % 22 % 20scrolling = % 22no % 22 % 20frameborder = % 220 % 22 % 20allowtransparency = % 22true % 22'' webView.loadDataWithBaseURL (null, str, "text/html", "UTF-8", null); ' – Aniruddha
@Aniruddha 귀하의 이전 의견은 이러한 problem.post 답변을 해결할 수 있도록 도와주세요 :'webView.loadDataWithBaseURL (null, " ","text/html ","UTF-8 ", null); 그렇다면 그 대답에 대한 설명을 좀 해주면 나에게도 좋다. – Steve