android - crash on Splash to Menu -
when splash screen moveed menu, program crashed. logcat details while crash follows :
04-24 11:40:17.082: e/androidruntime(3180): @ android.app.instrumentation.checkstartactivityresult(instrumentation.java:1508) 04-24 11:40:17.082: e/androidruntime(3180): @ android.app.instrumentation.execstartactivity(instrumentation.java:1384) 04-24 11:40:17.082: e/androidruntime(3180): @ android.app.activity.startactivityforresult(activity.java:3190) 04-24 11:40:17.082: e/androidruntime(3180): @ android.app.activity.startactivity(activity.java:3297) 04-24 11:40:17.082: e/androidruntime(3180): @ com.pearson.lagp.v3.startactivity$1.run(startactivity.java:68) 04-24 11:40:17.082: e/androidruntime(3180): @ android.os.handler.handlecallback(handler.java:605) 04-24 11:40:17.082: e/androidruntime(3180): @ android.os.handler.dispatchmessage(handler.java:92) 04-24 11:40:17.082: e/androidruntime(3180): @ android.os.looper.loop(looper.java:137) 04-24 11:40:17.082: e/androidruntime(3180): @ android.app.activitythread.main(activitythread.java:4448) 04-24 11:40:17.082: e/androidruntime(3180): @ java.lang.reflect.method.invokenative(native method) 04-24 11:40:17.082: e/androidruntime(3180): @ java.lang.reflect.method.invoke(method.java:511) 04-24 11:40:17.082: e/androidruntime(3180): @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:823) 04-24 11:40:17.082: e/androidruntime(3180): @ com.android.internal.os.zygoteinit.main(zygoteinit.java:590) 04-24 11:40:17.082: e/androidruntime(3180): @ dalvik.system.nativestart.main(native method)
and program screen moving:
package com.pearson.lagp.v3; import org.anddev.andengine.engine.engine; import org.anddev.andengine.engine.camera.camera; import org.anddev.andengine.engine.options.engineoptions; import org.anddev.andengine.engine.options.engineoptions.screenorientation; import org.anddev.andengine.engine.options.resolutionpolicy.ratioresolutionpolicy; import org.anddev.andengine.entity.scene.scene; import org.anddev.andengine.entity.sprite.sprite; import org.anddev.andengine.entity.util.fpslogger; import org.anddev.andengine.opengl.font.font; import org.anddev.andengine.opengl.texture.textureoptions; import org.anddev.andengine.opengl.texture.atlas.bitmap.bitmaptextureatlas; import org.anddev.andengine.opengl.texture.atlas.bitmap.bitmaptextureatlastextureregionfactory; import org.anddev.andengine.opengl.texture.region.textureregion; import org.anddev.andengine.ui.activity.basegameactivity; import android.content.intent; import android.os.handler; public class startactivity extends basegameactivity { private static final int camera_width = 480; private static final int camera_height = 320; private camera mcamera; private bitmaptextureatlas mbitmaptextureatlas; private textureregion msplashtextureregion; private font mfont; private handler mhandler; public engine onloadengine() { mhandler=new handler(); mhandler.removecallbacks(mlaunchtask); this.mcamera = new camera(0, 0, camera_width,camera_height); return new engine( new engineoptions( true, screenorientation.landscape, new ratioresolutionpolicy(camera_width,camera_height), this.mcamera ) ); } @override public void onloadresources() { mbitmaptextureatlas = new bitmaptextureatlas(512, 512,textureoptions.bilinear_premultiplyalpha); msplashtextureregion = bitmaptextureatlastextureregionfactory.createfromasset( this.mbitmaptextureatlas, this, "splashscreen.png", 0, 0 ); this.mengine.gettexturemanager().loadtexture(this.mbitmaptextureatlas); } @override public scene onloadscene() { this.mengine.registerupdatehandler(new fpslogger()); final scene scene = new scene(1); /* center splash on camera. */ final int centerx =(camera_width - this.msplashtextureregion.getwidth()) / 2; final int centery =(camera_height -this.msplashtextureregion.getheight()) / 2; /* create sprite , add scene. */ final sprite splash = new sprite(centerx,centery, this.msplashtextureregion); scene.getlastchild().attachchild(splash); return scene; } @override public void onloadcomplete() { mhandler.postdelayed(mlaunchtask, 3000); } private runnable mlaunchtask=new runnable(){ public void run(){ intent mintent=new intent(startactivity.this, mainmenuactivity.class); startactivity.this.startactivity(mintent); } }; }
and manifest after modify:
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.pearson.lagp.v3" android:versioncode="1" android:versionname="1.0" > <uses-sdk android:minsdkversion="8" android:targetsdkversion="18" /> <uses-permission android:name="android.permission.wake_lock" /> <application android:allowbackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/apptheme" > <activity android:name="com.pearson.lagp.v3.startactivity" 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.pearson.lagp.v3.mainmenuactivity" android:label="@string/menu_name"> </activity> </application> </manifest>
why crashed?
have declare activity in manifest?
or
check activity on manifest right package name?
unable find explicit activity class , unable instantiate activity
Comments
Post a Comment