Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/230.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/77.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
制作带有按钮到外部链接的android应用程序_Android_Jquery_Button_Hyperlink_Avd - Fatal编程技术网

制作带有按钮到外部链接的android应用程序

制作带有按钮到外部链接的android应用程序,android,jquery,button,hyperlink,avd,Android,Jquery,Button,Hyperlink,Avd,我想做一个按钮,链接到像google.com这样的网站。我使用jquery mobile+eclipse并尝试使用这个Google,它在android虚拟设备上运行良好,但当我将应用程序apk文件传输到手机上时,它就无法工作了。它只是显示了链接,没有我想要的按钮。为什么会这样?我应该在java、xml或AndroidTest.xml文件上添加什么代码?请帮忙 此外,我通过蓝牙传输了我的最终apk文件,而不是使用电缆。这可能是问题所在吗/ my MainActivity.java代码: packa

我想做一个按钮,链接到像google.com这样的网站。我使用jquery mobile+eclipse并尝试使用这个Google,它在android虚拟设备上运行良好,但当我将应用程序apk文件传输到手机上时,它就无法工作了。它只是显示了链接,没有我想要的按钮。为什么会这样?我应该在java、xml或AndroidTest.xml文件上添加什么代码?请帮忙

此外,我通过蓝牙传输了我的最终apk文件,而不是使用电缆。这可能是问题所在吗/

my MainActivity.java代码:

package com.example.testing;

import android.app.Activity;
import android.os.Bundle;
import android.view.Window;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class MainActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        this.requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.activity_main);

        WebView webView = (WebView) findViewById(R.id.webview);
        WebSettings webSettings = webView.getSettings();
        webSettings.setJavaScriptEnabled(true);
        webView.setWebViewClient(new WebViewClient());
        webView.loadUrl("file:///android_asset/index.html");

        return;
    }

}
my activity_main.xml:

<WebView xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/webview"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:scrollbars="none" />
AndroidManifest.xml:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.testing"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="15" />

    <uses-permission android:name="android.permission.INTERNET"></uses-permission>

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".MainActivity"
            android:label="@string/title_activity_main" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>
注意:我的标题和页脚也没有显示,因为它应该在我的真实手机。我也需要这方面的帮助:页眉、页脚和按钮功能

html文件:

<!DOCTYPE html>
<html>

<head>
    <title>Home Page</title>
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a1/jquery.mobile-1.0a1.min.css" />
    <script src="http://code.jquery.com/jquery-1.4.3.min.js"></script>
    <script src="http://code.jquery.com/mobile/1.0a1/jquery.mobile-1.0a1.min.js"></script>

    <link rel="stylesheet" type="text/css" href="css/event.css" />
</head>
<body>

<div data-role="page" data-theme="c" id="home">
    <div data-role="header">
        <h1>Hello</h1>
    </div>

    <div data-role="content">
        <p>
        <a href="https://www.google.com.sg/" rel="external" data-role="button">Google</a>
    <a href="http://www.channelnewsasia.com/" rel="external" data-role="button">CNA</a>
        </p>
    </div>

    <div data-role="footer">
    <h4>Bye</h4>
    </div>

</div>

</body>
</html>

你能在这里分享代码吗…?不,这不可能是问题所在…但我们需要代码来更好地理解你的问题。。!!这与你在手机上放置apk文件的方式无关。好吧,这就是我共享代码的原因。请看。