我怎么能显示的WebView一个互动式地图? [英] how can I display a interactive map in webview?

查看:98
本文介绍了我怎么能显示的WebView一个互动式地图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想显示我与imapbuilder创建的互动地图。问题是,当我在我的WebView加载它,我只是得到一个空白屏幕。我曾尝试一切(我只是想知道如果我的设备无法处理Flash已经得到SGS2和摩托罗拉xoom2 10.1in平板电脑ICS两个)。
这里是我的code为XML。

I am trying to display a interactive map that I have created with imapbuilder. The problem is when i load it in my webview I just get a blank screen. I have tried everything (am just wondering if my device can't handle flash have got sgs2 and Motorola xoom2 10.1in tablet with ICS on both). Here is my code for XML.

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >



<WebView android:id="@+id/webview"

    android:layout_width="fill_parent"
    android:layout_height="fill_parent"/>



</LinearLayout> 

有关我的.java;

For my .java;

import android.os.Bundle;
import android.app.Activity;
import android.os.Handler; 
import android.view.Window;
import android.view.WindowManager;
import android.webkit.WebView; 

public class MainActivity extends Activity { 

  private Handler mHandler = new Handler(); 

  @Override 
  public void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE); 
    this.getWindow().setFlags   
    (WindowManager.LayoutParams.FLAG_FULLSCREEN,
    WindowManager.LayoutParams.FLAG_FULLSCREEN); 
    setContentView(R.layout.activity_main); 
    WebView view=(WebView)findViewById(R.id.webview);
    view.getSettings().setPluginsEnabled(true);
    view.loadUrl("file:///android_asset/Interactive.htm"); 
    view.addJavascriptInterface(new MyJavaScriptInterface(), "Android"); 
} 

final class MyJavaScriptInterface 
{ 
    public void ProcessJavaScript(final String scriptname, final String args) 
        {              
            mHandler.post(new Runnable() 
                { 
                    public void run() 
                        { 
                            //Do your activities 
                        } 
                });
        }
}
}

在我的资产文件夹是Interactive.htm和闪光灯文件和材料,从我用的软件出口子文件夹中。
所以我要去哪里错了?

In my assets folder is the Interactive.htm and sub folder with the flash files and stuff exported from the software I used. So where am I going wrong?

推荐答案

你有没有这个权限添加到您的清单文件?

Did you add this permission to your manifest file?

&LT;使用许可权的android:NAME =android.permission.INTERNET对/&GT;

这篇关于我怎么能显示的WebView一个互动式地图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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