user2755971
user2755971

Reputation: 17

Please help my app keeps crashing on my phone and Emulator

My app will install, but when I run it, pops up then goes black and crashes.

package com.QuinnCo.syndicateprojectyoutubechannel;

import android.app.Activity;
import android.webkit.WebView;
import android.os.Bundle;

public class CopyOfMainActivity extends Activity {*

WebView webview;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    webview = (WebView) findViewById(R.id.webview);
    webview.getSettings().setJavaScriptEnabled(true);
    webview.loadUrl("http://www.youtube.com/thesyndicateproject"); 


}

}

Thats my mainactivity,java

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

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

<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.QuinnCo.syndicateprojectyoutubechannel"
        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>

Android Manifest

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

Activity main..

I tried so much and it just wont work. Actually ALL apps I make will not work if I edit it. I am hoping one of you can find an error that I can fix. This is supposed to be a WebView application.

Upvotes: 0

Views: 176

Answers (1)

Raghav Sood
Raghav Sood

Reputation: 82533

Change:

<activity
    android:name="com.QuinnCo.syndicateprojectyoutubechannel"
    android:label="@string/app_name" >

To

<activity
    android:name="com.QuinnCo.syndicateprojectyoutubechannel.CopyOfMainActivity"
    android:label="@string/app_name" >

Upvotes: 2

Related Questions