Hey fellow programmers,
I need some help trying to figure out why my web browser in my android application is crashing. Any help would be great. I will post my codes on the affected JAVA classes that is connected to the browser, technically its quite a big program with different classes. I'll also include the android manifest file. So the last checkup that I did was I tried opening it with my tablet under Jelly Bean but its still crashing.
This is the code for the webactivity class
package com.example.gamaraza;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;
public class WebActivity extends Activity {
private WebView webView;
@SuppressLint("SetJavaScriptEnabled")
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.weblayout);
webView = (WebView) findViewById(R.id.buttonUrl);;
webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl("https://www.google.com");
}
}
Android Manifest would be
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://ift.tt/nIICcg"
package="com.example.gamaraza"
android:versionCode="1"
android:versionName="1.0" >
<compatible-screens>
<!-- all small size screens -->
<screen android:screenSize="small" android:screenDensity="ldpi" />
<screen android:screenSize="small" android:screenDensity="mdpi" />
<screen android:screenSize="small" android:screenDensity="hdpi" />
<screen android:screenSize="small" android:screenDensity="xhdpi" />
<!-- all normal size screens -->
<screen android:screenSize="normal" android:screenDensity="ldpi" />
<screen android:screenSize="normal" android:screenDensity="mdpi" />
<screen android:screenSize="normal" android:screenDensity="hdpi" />
<screen android:screenSize="normal" android:screenDensity="xhdpi" />
<screen android:screenSize="large" android:screenDensity="ldpi" />
<screen android:screenSize="large" android:screenDensity="mdpi" />
<screen android:screenSize="large" android:screenDensity="hdpi" />
<screen android:screenSize="large" android:screenDensity="xhdpi" />
<screen android:screenSize="xlarge" android:screenDensity="ldpi" />
<screen android:screenSize="xlarge" android:screenDensity="mdpi" />
<screen android:screenSize="xlarge" android:screenDensity="hdpi" />
<screen android:screenSize="xlarge" android:screenDensity="xhdpi" />
</compatible-screens>
<supports-screens android:resizeable="false"
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"
android:anyDensity="true"
android:requiresSmallestWidthDp="240"
android:compatibleWidthLimitDp="240"
android:largestWidthLimitDp="320"/>
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.WRITE_SETTINGS"/>
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="@drawable/glauncher"
android:label="@string/app_name"
android:theme="@android:style/Theme.Light.NoTitleBar" >
<activity
android:name="com.example.gamaraza.MainActivity"
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:label="@string/app_name"
android:name="com.example.gamaraza.CreditActivity" >
</activity>
<activity
android:label="@string/app_name"
android:name="com.example.gamaraza.DubActivity" >
</activity>
<activity
android:label="@string/app_name"
android:name="com.example.gamaraza.AboutActivity" >
</activity>
<activity
android:label="@string/app_name"
android:name="com.example.gamaraza.SettingsActivity" >
</activity>
<activity
android:name=".WebViewActivity"
android:theme="@android:style/Theme.NoTitleBar" />
<activity
android:label="@string/app_name"
android:name=".WebBrowser" >
</activity>
</application>
</manifest>
Aucun commentaire:
Enregistrer un commentaire