Firstly, i apologize but i am a beginner to android development and with the forum. When i go to run the application on my emulator i get the error; "the application (app name) has stopped unexpectedly. Please try again." And i am struggling to interpret my log cat. I have also tried adjusting 'MAIN' and 'MENU' names in the manifest and the src file to match up but know results unless i am missing something. Here is my logcat:
01-06 16:50:32.273: D/dalvikvm(490): GC_EXTERNAL_ALLOC freed 652 objects / 51480 bytes in 92ms
01-06 16:50:37.813: D/AndroidRuntime(490): Shutting down VM
01-06 16:50:37.813: W/dalvikvm(490): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
01-06 16:50:37.863: E/AndroidRuntime(490): FATAL EXCEPTION: main
01-06 16:50:37.863: E/AndroidRuntime(490): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.knight.baseproject/com.knight.baseproject.com.knight.baseproject.MENU}: java.lang.ClassNotFoundException: com.knight.baseproject.com.knight.baseproject.MENU in loader dalvik.system.PathClassLoader[/data/app/com.knight.baseproject-2.apk]
01-06 16:50:37.863: E/AndroidRuntime(490): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)
01-06 16:50:37.863: E/AndroidRuntime(490): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
01-06 16:50:37.863: E/AndroidRuntime(490): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
01-06 16:50:37.863: E/AndroidRuntime(490): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
01-06 16:50:37.863: E/AndroidRuntime(490): at android.os.Handler.dispatchMessage(Handler.java:99)
01-06 16:50:37.863: E/AndroidRuntime(490): at android.os.Looper.loop(Looper.java:123)
01-06 16:50:37.863: E/AndroidRuntime(490): at android.app.ActivityThread.main(ActivityThread.java:4627)
01-06 16:50:37.863: E/AndroidRuntime(490): at java.lang.reflect.Method.invokeNative(Native Method)
01-06 16:50:37.863: E/AndroidRuntime(490): at java.lang.reflect.Method.invoke(Method.java:521)
01-06 16:50:37.863: E/AndroidRuntime(490): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
01-06 16:50:37.863: E/AndroidRuntime(490): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
01-06 16:50:37.863: E/AndroidRuntime(490): at dalvik.system.NativeStart.main(Native Method)
01-06 16:50:37.863: E/AndroidRuntime(490): Caused by: java.lang.ClassNotFoundException: com.knight.baseproject.com.knight.baseproject.MENU in loader dalvik.system.PathClassLoader[/data/app/com.knight.baseproject-2.apk]
01-06 16:50:37.863: E/AndroidRuntime(490): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
01-06 16:50:37.863: E/AndroidRuntime(490): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
01-06 16:50:37.863: E/AndroidRuntime(490): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
01-06 16:50:37.863: E/AndroidRuntime(490): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
01-06 16:50:37.863: E/AndroidRuntime(490): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
01-06 16:50:37.863: E/AndroidRuntime(490): ... 11 more
Here is the Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.knight.baseproject"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="19" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.knight.baseproject.MAIN"
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:name=".com.knight.baseproject.MENU"
android:label="@string/app_name" >
<intent-filter>
<action android:name="com.knight.baseproject.MENU" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
Here is the 'MAIN' java script:
package com.knight.baseproject;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
public class MAIN extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.splash);
Thread logoTimer = new Thread(){
public void run(){
try{
sleep(5000);
Intent menuIntent = new Intent("com.knight.baseproject.MENU");
startActivity(menuIntent);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
finally{
finish();
}
}
};
logoTimer.start();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
}
The 'MENU' java (which i believe to have no impact):
package com.knight.baseproject;
import android.app.Activity;
import android.os.Bundle;
public class MENU extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
@Override
protected void onPause() {
// TODO Auto-generated method stub
super.onPause();
}
}