• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Canvas, SurfaceHolder, and Panels. Oh My!

cmh0114

Well-Known Member
I'm having some huge troubles with accessing my Panels and SurfaceHolders and Canvases in my program. The code is below (three separate classes), and the program will crash before it even displays anything. Any tips someone can give would be awesome. This is pretty much copy-and-paste from Google's Lunar Lander, but I apparently messed something up.

Code:
public class myActivity extends Activity 
{
	LinearLayout mLinearLayout;

    
	/** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) 
    {
    	Panel panel = new Panel(getApplicationContext());
    }
}

and

Code:
public class Panel extends SurfaceView implements SurfaceHolder.Callback {

	private CanvasThread canvasThread;
	
    public Panel(Context context) {
	    super(context); 
	    
	    getHolder().addCallback(this);
	    canvasThread = new CanvasThread(getHolder(),getContext(),getHandler());
	    setFocusable(true);
}
	
    @Override
    public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
        // TODO Auto-generated method stub
    }
 
    @Override
    public void surfaceCreated(SurfaceHolder holder) {
        // TODO Auto-generated method stub
        canvasThread.setRunning(true);
        canvasThread.start();
    }
 
    @Override
    public void surfaceDestroyed(SurfaceHolder holder) {
        // TODO Auto-generated method stub
        
    	boolean retry = true;
        canvasThread.setRunning(false);
        while (retry) {
                try {
                        canvasThread.join();
                        retry = false;
                } catch (InterruptedException e) {
                        // we will try it again and again...
                }
        }
    }
    @Override
    public void onDraw(Canvas canvas) {
            
            Paint paint = new Paint();
            

            Bitmap icon = BitmapFactory.decodeResource(getResources(),
                            R.drawable.icon);
            canvas.drawColor(Color.BLACK);
            canvas.drawBitmap(icon, 10, 10, null);
            
    }

}

and

Code:
package com.mst.Splat;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.os.Handler;
import android.view.SurfaceHolder;

public class CanvasThread extends Thread {

	private SurfaceHolder mSurfaceHolder;
	private Context mContext;
	private Handler mHandler;
	private boolean mRun;
	
	public CanvasThread(SurfaceHolder surfaceHolder, Context context, 
			Handler handler)
	{
        mSurfaceHolder = surfaceHolder;
        mHandler = handler;
        mContext = context;
	}
	public void setRunning(boolean b)
	{
		mRun = b;
	}
	public void run()
	{
	   while (mRun) {
           Canvas c = null;
           try {
               c = mSurfaceHolder.lockCanvas(null);
               synchronized (mSurfaceHolder) {
                   //if (mMode == STATE_RUNNING) updatePhysics();
            	   //Later, I'll use the original code -- this is just temp
            	   //this should only be implemented when the game is running
//            	   if(true) updatePhysics();
                   doDraw(c);
               }
           } finally {
               // do this in a finally so that if an exception is thrown
               // during the above, we don't leave the Surface in an
               // inconsistent state
               if (c != null) {
                   mSurfaceHolder.unlockCanvasAndPost(c);
               }
           }
	   }
	}
	public void doDraw(Canvas canvas)
	{
        // Draw the background image. Operations on the Canvas accumulate
        // so this is like clearing the screen.      
		Bitmap mBackgroundImage = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.background);
        canvas.drawBitmap(mBackgroundImage, 0, 0, null);
        Bitmap mIcon = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.icon);
        canvas.drawBitmap(mIcon, 0, 0, null);
	}
}
 
Ok, so I found a cut-down version of the Lunar Lander that has less code, but still most of the stuff that LL has to run. Here's that:

Main class:
Code:
package com.mst.Splat;


import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.GridView;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.Toast;
import android.widget.AdapterView.OnItemClickListener;



public class SplatActivity extends Activity 
{
	public SplatActivity act = this;
	LinearLayout mLinearLayout;

    
	/** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) 
    {

    	setContentView(R.layout.main);
    	
    	setTitle("Splat");
    	
    	super.onCreate(savedInstanceState);
		//setContentView(R.layout.main);
		
		GridView gridview = (GridView)findViewById(R.id.gridview);
        gridview.setAdapter(new ImageAdapter(this));
        gridview.setPadding(1,300,1,1);

        
        gridview.setOnItemClickListener(new OnItemClickListener() 
        {
      
		      public void onItemClick(AdapterView<?> parent, View v, int position, long id) 
		      {
                //Toast.makeText(SplatActivity.this, "" + position, Toast.LENGTH_SHORT).show();
                switch(position)
                {
	                case 0: //Play
	                	Toast.makeText(SplatActivity.this, "Play", Toast.LENGTH_SHORT).show();
	                	startActivity(new Intent(SplatActivity.this, Play.class));
	                	break;
	                case 1: //Instructions
	                	Toast.makeText(SplatActivity.this, "Instructions", Toast.LENGTH_SHORT).show();
	                	setContentView(R.layout.instructions_layout);
	                	ImageView instructions = (ImageView)findViewById(R.id.instructions);
	                	ImageButton backButton = (ImageButton)findViewById(R.id.backButton);
	                	backButton.setBackgroundColor(0);
	                	backButton.setOnClickListener(new View.OnClickListener() {
	                        public void onClick(View v) {
	                            startActivity(new Intent(SplatActivity.this, SplatActivity.class));
	                            SplatActivity.this.finish();
	                        }
	                    });
	                	break;
	                case 2: //High Scores
	                	HighScores highScore = new HighScores(SplatActivity.this);
	                	Toast.makeText(SplatActivity.this, "High Scores", Toast.LENGTH_SHORT).show();
	                	break;
	                case 3: //Quit
	                	Toast.makeText(SplatActivity.this, "Quit", Toast.LENGTH_SHORT).show();
	                	SplatActivity.this.finish();
	                	break;
                }
		      }
        });   
    	 

   
    }  
}

Play Class:
Code:
package com.mst.Splat;

import java.io.IOException;
import java.util.ArrayList;

import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.res.Resources;
import android.content.res.XmlResourceParser;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.os.Bundle;
import android.util.AttributeSet;
import android.view.Display;
import android.view.SurfaceHolder;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.view.View.OnClickListener;
import android.widget.ImageButton;
import android.widget.Toast;

public class Play extends Activity
{
	
	private Context layout;
	private Character character;
	private ImageButton blueButton, redButton, yellowButton;
	private int paintColor;
	public static ArrayList<Tile> tiles = new ArrayList<Tile>();
	
	public static Play play;
	public static Display display;
	public static int width;
	public static int height;
	
	public void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		
    	startActivity(new Intent(Play.this, GameTemplate.class));
           }

}

and the GameTemplate Class:
Code:
package com.mst.Splat;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.Window;

import com.mst.Splat.PlayView.GameThread;

public class GameTemplate extends Activity {
    private static final int MENU_PAUSE = Menu.FIRST;

    private static final int MENU_RESUME = Menu.FIRST + 1;

    private static final int MENU_START = Menu.FIRST + 2;

    private static final int MENU_STOP = Menu.FIRST + 3;

    /** A handle to the thread that's actually running the animation. */
    private GameThread mGameThread;

    /** A handle to the View in which the game is running. */
    private PlayView mGameView;

    /**
     * Invoked during init to give the Activity a chance to set up its Menu.
     * 
     * @param menu the Menu to which entries may be added
     * @return true
     */
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        super.onCreateOptionsMenu(menu);

        menu.add(0, MENU_START, 0, R.string.menu_start);
        menu.add(0, MENU_STOP, 0, R.string.menu_stop);
        menu.add(0, MENU_PAUSE, 0, R.string.menu_pause);
        menu.add(0, MENU_RESUME, 0, R.string.menu_resume);

        return true;
    }

    /**
     * Invoked when the user selects an item from the Menu.
     * 
     * @param item the Menu entry which was selected
     * @return true if the Menu item was legit (and we consumed it), false
     *         otherwise
     */
    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case MENU_START:
                mGameThread.doStart();
                return true;
            case MENU_STOP:
                mGameThread.setState(GameThread.STATE_LOSE);
                return true;
            case MENU_PAUSE:
                mGameThread.pause();
                return true;
            case MENU_RESUME:
                mGameThread.unpause();
                return true;
        }

        return false;
    }

    /**
     * Invoked when the Activity is created.
     * 
     * @param savedInstanceState a Bundle containing state saved from a previous
     *        execution, or null if this is a new execution
     */
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        //super.onCreate(savedInstanceState);
//
//        // turn off the window's title bar
//        requestWindowFeature(Window.FEATURE_NO_TITLE);
//
//        // tell system to use the layout defined in our XML file
//        setContentView(R.layout.main);
//
//        // get handles to the LunarView from XML, and its LunarThread
//        mGameView = (PlayView) findViewById(R.id.game);
//        mGameThread = mGameView.getThread();
//
//        // set up a new game
//        mGameThread.setState(GameThread.STATE_READY);
//        Log.w(this.getClass().getName(), "SIS is null");
    }

    /**
     * Invoked when the Activity loses user focus.
     */
    @Override
    protected void onPause() {
        super.onPause();
        mGameView.getThread().pause(); // pause game when Activity pauses
    }
}


And to be honest, I have absolutely no clue what any of the logcat stuff means, so I'm just going to copy and paste all of that in as well. I've never used it before.

Code:
08-19 19:17:05.149: DEBUG/AndroidRuntime(654): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
08-19 19:17:05.169: DEBUG/AndroidRuntime(654): CheckJNI is ON
08-19 19:17:06.269: DEBUG/AndroidRuntime(654): --- registering native functions ---
08-19 19:17:10.929: DEBUG/AndroidRuntime(654): Shutting down VM
08-19 19:17:10.948: DEBUG/dalvikvm(654): DestroyJavaVM waiting for non-daemon threads to exit
08-19 19:17:10.958: DEBUG/dalvikvm(654): DestroyJavaVM shutting VM down
08-19 19:17:10.958: DEBUG/dalvikvm(654): HeapWorker thread shutting down
08-19 19:17:10.970: ERROR/AndroidRuntime(654): ERROR: thread attach failed
08-19 19:17:10.989: DEBUG/dalvikvm(654): HeapWorker thread has shut down
08-19 19:17:10.989: DEBUG/jdwp(654): JDWP shutting down net...
08-19 19:17:10.989: INFO/dalvikvm(654): Debugger has detached; object registry had 1 entries
08-19 19:17:11.028: DEBUG/dalvikvm(654): VM cleaning up
08-19 19:17:11.210: DEBUG/dalvikvm(654): LinearAlloc 0x0 used 627556 of 5242880 (11%)
08-19 19:17:13.530: DEBUG/AndroidRuntime(662): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
08-19 19:17:13.549: DEBUG/AndroidRuntime(662): CheckJNI is ON
08-19 19:17:15.628: DEBUG/AndroidRuntime(662): --- registering native functions ---
08-19 19:17:16.369: INFO/ActivityManager(61): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10200000 cmp=com.android.launcher/.Launcher }
08-19 19:17:20.000: WARN/InputManagerService(61): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@43d9e648 (uid=10026 pid=645)
08-19 19:17:26.249: INFO/ActivityManager(61): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.mst.Splat/.SplatActivity }
08-19 19:17:26.519: DEBUG/AndroidRuntime(662): Shutting down VM
08-19 19:17:26.530: DEBUG/dalvikvm(662): DestroyJavaVM waiting for non-daemon threads to exit
08-19 19:17:26.538: DEBUG/dalvikvm(662): DestroyJavaVM shutting VM down
08-19 19:17:26.569: ERROR/AndroidRuntime(662): ERROR: thread attach failed
08-19 19:17:26.620: DEBUG/dalvikvm(662): HeapWorker thread shutting down
08-19 19:17:26.629: DEBUG/dalvikvm(662): HeapWorker thread has shut down
08-19 19:17:26.639: DEBUG/jdwp(662): JDWP shutting down net...
08-19 19:17:26.649: INFO/dalvikvm(662): Debugger has detached; object registry had 1 entries
08-19 19:17:26.710: DEBUG/dalvikvm(662): VM cleaning up
08-19 19:17:27.468: DEBUG/dalvikvm(662): LinearAlloc 0x0 used 637524 of 5242880 (12%)
08-19 19:17:30.679: DEBUG/dalvikvm(248): GC freed 165 objects / 6608 bytes in 5168ms
08-19 19:17:35.260: DEBUG/dalvikvm(128): GC freed 2427 objects / 139560 bytes in 655ms
08-19 19:17:37.459: INFO/NotificationService(61): enqueueToast pkg=com.mst.Splat callback=android.app.ITransientNotification$Stub$Proxy@43ce7850 duration=0
08-19 19:17:37.648: INFO/ActivityManager(61): Starting activity: Intent { cmp=com.mst.Splat/.Play }
08-19 19:17:38.579: INFO/ActivityManager(61): Starting activity: Intent { cmp=com.mst.Splat/.GameTemplate }
08-19 19:17:38.680: DEBUG/AndroidRuntime(645): Shutting down VM
08-19 19:17:38.720: WARN/dalvikvm(645): threadid=3: thread exiting with uncaught exception (group=0x4001b188)
08-19 19:17:38.769: ERROR/AndroidRuntime(645): Uncaught handler: thread main exiting due to uncaught exception
08-19 19:17:38.948: ERROR/AndroidRuntime(645): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mst.Splat/com.mst.Splat.Play}: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.mst.Splat/com.mst.Splat.GameTemplate}; have you declared this activity in your AndroidManifest.xml?
08-19 19:17:38.948: ERROR/AndroidRuntime(645):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)
08-19 19:17:38.948: ERROR/AndroidRuntime(645):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
08-19 19:17:38.948: ERROR/AndroidRuntime(645):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)
08-19 19:17:38.948: ERROR/AndroidRuntime(645):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
08-19 19:17:38.948: ERROR/AndroidRuntime(645):     at android.os.Handler.dispatchMessage(Handler.java:99)
08-19 19:17:38.948: ERROR/AndroidRuntime(645):     at android.os.Looper.loop(Looper.java:123)
08-19 19:17:38.948: ERROR/AndroidRuntime(645):     at android.app.ActivityThread.main(ActivityThread.java:4363)
08-19 19:17:38.948: ERROR/AndroidRuntime(645):     at java.lang.reflect.Method.invokeNative(Native Method)
08-19 19:17:38.948: ERROR/AndroidRuntime(645):     at java.lang.reflect.Method.invoke(Method.java:521)
08-19 19:17:38.948: ERROR/AndroidRuntime(645):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
08-19 19:17:38.948: ERROR/AndroidRuntime(645):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
08-19 19:17:38.948: ERROR/AndroidRuntime(645):     at dalvik.system.NativeStart.main(Native Method)
08-19 19:17:38.948: ERROR/AndroidRuntime(645): Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.mst.Splat/com.mst.Splat.GameTemplate}; have you declared this activity in your AndroidManifest.xml?
08-19 19:17:38.948: ERROR/AndroidRuntime(645):     at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1404)
08-19 19:17:38.948: ERROR/AndroidRuntime(645):     at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378)
08-19 19:17:38.948: ERROR/AndroidRuntime(645):     at android.app.Activity.startActivityForResult(Activity.java:2749)
08-19 19:17:38.948: ERROR/AndroidRuntime(645):     at android.app.Activity.startActivity(Activity.java:2855)
08-19 19:17:38.948: ERROR/AndroidRuntime(645):     at com.mst.Splat.Play.onCreate(Play.java:47)
08-19 19:17:38.948: ERROR/AndroidRuntime(645):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
08-19 19:17:38.948: ERROR/AndroidRuntime(645):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)
08-19 19:17:38.948: ERROR/AndroidRuntime(645):     ... 11 more
08-19 19:17:39.079: INFO/Process(61): Sending signal. PID: 645 SIG: 3
08-19 19:17:39.099: INFO/dalvikvm(645): threadid=7: reacting to signal 3
08-19 19:17:39.469: INFO/dalvikvm(645): Wrote stack trace to '/data/anr/traces.txt'
08-19 19:17:42.720: INFO/Process(645): Sending signal. PID: 645 SIG: 9
08-19 19:17:43.280: INFO/ActivityManager(61): Process com.mst.Splat (pid 645) has died.
08-19 19:17:43.390: INFO/WindowManager(61): WIN DEATH: Window{43da07d8 com.mst.Splat/com.mst.Splat.SplatActivity paused=false}
08-19 19:17:43.489: INFO/WindowManager(61): WIN DEATH: Window{43da55d8 Toast paused=false}
08-19 19:17:44.210: INFO/ActivityManager(61): Start proc com.mst.Splat for activity com.mst.Splat/.SplatActivity: pid=670 uid=10026 gids={}
08-19 19:17:46.259: DEBUG/ddm-heap(670): Got feature list request
08-19 19:17:46.810: INFO/UsageStats(61): Unexpected resume of com.mst.Splat while already resumed in com.mst.Splat
08-19 19:17:47.919: WARN/ActivityManager(61): Launch timeout has expired, giving up wake lock!
08-19 19:17:50.740: DEBUG/dalvikvm(670): GC freed 548 objects / 48176 bytes in 1235ms
08-19 19:17:56.740: WARN/InputManagerService(61): Got RemoteException sending setActive(false) notification to pid 645 uid 10026
08-19 19:17:56.849: WARN/ActivityManager(61): Activity idle timeout for HistoryRecord{43cbb118 com.mst.Splat/.SplatActivity}
08-19 19:17:58.460: INFO/ActivityManager(61): Displayed activity com.mst.Splat/.SplatActivity: 14515 ms (total 20284 ms)

Anyways, sorry for throwing so much code at you, lol, but I'm pretty new at this and don't know which code will help you help me and which code is just garbage atm, so I'm just giving you all of it in hopes that you can sort through it, seeing as you know what you're doing. :P

If you're actually going to go through all of that and try to help me figure out what the problem is, I'll be extremely grateful. XD
 
Definetly read up on Java console output and Logcat as this is how you find out where your errors are.

Here is your error:
Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.mst.Splat/com.mst.Splat.GameTemplate}; have you declared this activity in your AndroidManifest.xml?

And it actual tells you what to do to fix it, et voila
 
Ok, so I tried that, and it still won't run. It ends at the same place. Here's the logcat:

Code:
08-19 19:57:51.155: DEBUG/AndroidRuntime(218): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
08-19 19:57:51.174: DEBUG/AndroidRuntime(218): CheckJNI is ON
08-19 19:57:52.365: DEBUG/AndroidRuntime(218): --- registering native functions ---
08-19 19:57:57.594: DEBUG/PackageParser(62): Scanning package: /data/app/vmdl29185.tmp
08-19 19:57:59.245: INFO/PackageManager(62): Removing non-system package:com.mst.Splat
08-19 19:57:59.264: DEBUG/PackageManager(62): Removing package com.mst.Splat
08-19 19:57:59.284: DEBUG/PackageManager(62):   Activities: com.mst.Splat.SplatActivity com.mst.Splat.Play com.mst.Splat.GameTemplate
08-19 19:57:59.624: DEBUG/PackageManager(62): Scanning package com.mst.Splat
08-19 19:57:59.645: INFO/PackageManager(62): /data/app/vmdl29185.tmp changed; unpacking
08-19 19:57:59.764: DEBUG/installd(32): DexInv: --- BEGIN '/data/app/vmdl29185.tmp' ---
08-19 19:58:01.694: DEBUG/dalvikvm(224): DexOpt: load 281ms, verify 516ms, opt 12ms
08-19 19:58:01.795: DEBUG/installd(32): DexInv: --- END '/data/app/vmdl29185.tmp' (success) ---
08-19 19:58:01.824: DEBUG/ActivityManager(62): Uninstalling process com.mst.Splat
08-19 19:58:01.844: DEBUG/PackageManager(62):   Activities: com.mst.Splat.SplatActivity com.mst.Splat.Play com.mst.Splat.GameTemplate
08-19 19:58:02.216: INFO/installd(32): move /data/dalvik-cache/data@app@vmdl29185.tmp@classes.dex -> /data/dalvik-cache/data@app@com.mst.Splat.apk@classes.dex
08-19 19:58:02.244: DEBUG/PackageManager(62): New package installed in /data/app/com.mst.Splat.apk
08-19 19:58:02.684: DEBUG/AndroidRuntime(218): Shutting down VM
08-19 19:58:02.704: DEBUG/dalvikvm(218): DestroyJavaVM waiting for non-daemon threads to exit
08-19 19:58:02.745: ERROR/AndroidRuntime(218): ERROR: thread attach failed
08-19 19:58:02.754: DEBUG/dalvikvm(218): DestroyJavaVM shutting VM down
08-19 19:58:02.814: DEBUG/dalvikvm(218): HeapWorker thread shutting down
08-19 19:58:02.845: DEBUG/dalvikvm(218): HeapWorker thread has shut down
08-19 19:58:02.845: DEBUG/jdwp(218): JDWP shutting down net...
08-19 19:58:02.865: INFO/dalvikvm(218): Debugger has detached; object registry had 1 entries
08-19 19:58:02.904: DEBUG/dalvikvm(218): VM cleaning up
08-19 19:58:03.215: DEBUG/ActivityManager(62): Uninstalling process com.mst.Splat
08-19 19:58:03.244: DEBUG/dalvikvm(218): LinearAlloc 0x0 used 621940 of 5242880 (11%)
08-19 19:58:03.835: WARN/ResourceType(62): Resources don't contain package for resource number 0x7f0700e5
08-19 19:58:03.874: WARN/ResourceType(62): Resources don't contain package for resource number 0x7f020031
08-19 19:58:03.874: WARN/ResourceType(62): Resources don't contain package for resource number 0x7f020030
08-19 19:58:03.895: WARN/ResourceType(62): Resources don't contain package for resource number 0x7f050000
08-19 19:58:04.125: WARN/ResourceType(62): Resources don't contain package for resource number 0x7f060001
08-19 19:58:04.565: WARN/ResourceType(62): Resources don't contain package for resource number 0x7f060000
08-19 19:58:05.005: INFO/ActivityManager(62): Start proc com.svox.pico for broadcast com.svox.pico/.VoiceDataInstallerReceiver: pid=229 uid=10019 gids={}
08-19 19:58:05.784: DEBUG/dalvikvm(110): GC freed 1918 objects / 102064 bytes in 1827ms
08-19 19:58:07.405: DEBUG/dalvikvm(62): GC freed 14887 objects / 906360 bytes in 2367ms
08-19 19:58:07.425: DEBUG/ddm-heap(229): Got feature list request
08-19 19:58:10.384: WARN/ResourceType(62): Resources don't contain package for resource number 0x7f0700e5
08-19 19:58:10.405: WARN/ResourceType(62): Resources don't contain package for resource number 0x7f020031
08-19 19:58:10.415: WARN/ResourceType(62): Resources don't contain package for resource number 0x7f020030
08-19 19:58:10.434: WARN/ResourceType(62): Resources don't contain package for resource number 0x7f050000
08-19 19:58:10.785: WARN/ResourceType(62): Resources don't contain package for resource number 0x7f060001
08-19 19:58:11.125: WARN/ResourceType(62): Resources don't contain package for resource number 0x7f060000
08-19 19:58:12.084: DEBUG/AndroidRuntime(233): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
08-19 19:58:12.125: DEBUG/AndroidRuntime(233): CheckJNI is ON
08-19 19:58:14.684: DEBUG/AndroidRuntime(233): --- registering native functions ---
08-19 19:58:20.154: INFO/ActivityManager(62): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.mst.Splat/.SplatActivity }
08-19 19:58:20.425: DEBUG/AndroidRuntime(233): Shutting down VM
08-19 19:58:20.435: DEBUG/dalvikvm(233): DestroyJavaVM waiting for non-daemon threads to exit
08-19 19:58:20.496: DEBUG/dalvikvm(233): DestroyJavaVM shutting VM down
08-19 19:58:20.505: DEBUG/dalvikvm(233): HeapWorker thread shutting down
08-19 19:58:20.525: DEBUG/dalvikvm(233): HeapWorker thread has shut down
08-19 19:58:20.525: DEBUG/jdwp(233): JDWP shutting down net...
08-19 19:58:20.564: INFO/dalvikvm(233): Debugger has detached; object registry had 1 entries
08-19 19:58:20.585: DEBUG/dalvikvm(233): VM cleaning up
08-19 19:58:20.595: ERROR/AndroidRuntime(233): ERROR: thread attach failed
08-19 19:58:21.285: DEBUG/dalvikvm(233): LinearAlloc 0x0 used 637524 of 5242880 (12%)
08-19 19:58:21.344: INFO/ActivityManager(62): Start proc com.mst.Splat for activity com.mst.Splat/.SplatActivity: pid=244 uid=10026 gids={}
08-19 19:58:22.504: DEBUG/ddm-heap(244): Got feature list request
08-19 19:58:23.174: INFO/ARMAssembler(62): generated scanline__00000177:03515104_00000001_00000000 [ 73 ipp] (95 ins) at [0x303cf8:0x303e74] in 3566095 ns
08-19 19:58:24.495: DEBUG/dalvikvm(244): GC freed 546 objects / 48088 bytes in 454ms
08-19 19:58:26.834: INFO/ActivityManager(62): Displayed activity com.mst.Splat/.SplatActivity: 6427 ms (total 6427 ms)
08-19 19:58:27.044: INFO/ARMAssembler(62): generated scanline__00000077:03545404_00000A04_00000000 [ 29 ipp] (51 ins) at [0x303e78:0x303f44] in 1562769 ns
08-19 19:58:31.704: INFO/NotificationService(62): enqueueToast pkg=com.mst.Splat callback=android.app.ITransientNotification$Stub$Proxy@43ccc540 duration=0
08-19 19:58:31.764: INFO/ActivityManager(62): Starting activity: Intent { cmp=com.mst.Splat/.Play }
08-19 19:58:32.274: INFO/ActivityManager(62): Starting activity: Intent { cmp=com.mst.Splat/.GameTemplate }
08-19 19:58:32.585: INFO/ARMAssembler(62): generated scanline__00000177:03515104_00001A01_00000000 [ 73 ipp] (98 ins) at [0x3bb590:0x3bb718] in 2394159 ns
08-19 19:58:33.065: DEBUG/AndroidRuntime(244): Shutting down VM
08-19 19:58:33.085: WARN/dalvikvm(244): threadid=3: thread exiting with uncaught exception (group=0x4001b188)
08-19 19:58:33.114: ERROR/AndroidRuntime(244): Uncaught handler: thread main exiting due to uncaught exception
08-19 19:58:33.165: ERROR/AndroidRuntime(244): android.app.SuperNotCalledException: Activity {com.mst.Splat/com.mst.Splat.GameTemplate} did not call through to super.onCreate()
08-19 19:58:33.165: ERROR/AndroidRuntime(244):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2461)
08-19 19:58:33.165: ERROR/AndroidRuntime(244):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
08-19 19:58:33.165: ERROR/AndroidRuntime(244):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)
08-19 19:58:33.165: ERROR/AndroidRuntime(244):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
08-19 19:58:33.165: ERROR/AndroidRuntime(244):     at android.os.Handler.dispatchMessage(Handler.java:99)
08-19 19:58:33.165: ERROR/AndroidRuntime(244):     at android.os.Looper.loop(Looper.java:123)
08-19 19:58:33.165: ERROR/AndroidRuntime(244):     at android.app.ActivityThread.main(ActivityThread.java:4363)
08-19 19:58:33.165: ERROR/AndroidRuntime(244):     at java.lang.reflect.Method.invokeNative(Native Method)
08-19 19:58:33.165: ERROR/AndroidRuntime(244):     at java.lang.reflect.Method.invoke(Method.java:521)
08-19 19:58:33.165: ERROR/AndroidRuntime(244):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
08-19 19:58:33.165: ERROR/AndroidRuntime(244):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
08-19 19:58:33.165: ERROR/AndroidRuntime(244):     at dalvik.system.NativeStart.main(Native Method)
08-19 19:58:33.234: INFO/Process(62): Sending signal. PID: 244 SIG: 3
08-19 19:58:33.244: INFO/dalvikvm(244): threadid=7: reacting to signal 3
08-19 19:58:33.344: INFO/dalvikvm(244): Wrote stack trace to '/data/anr/traces.txt'
08-19 19:58:41.834: WARN/ActivityManager(62): Launch timeout has expired, giving up wake lock!
08-19 19:58:42.014: WARN/ActivityManager(62): Activity idle timeout for HistoryRecord{43cc16b8 com.mst.Splat/.Play}
08-19 19:58:42.735: WARN/ActivityManager(62): Activity idle timeout for HistoryRecord{43ce73d8 com.mst.Splat/.GameTemplate}
08-19 19:58:48.244: DEBUG/dalvikvm(110): GC freed 2444 objects / 140264 bytes in 467ms

I think the problem is this, but I don't know how to fix it:
Code:
08-19 19:58:02.745: ERROR/AndroidRuntime(218): ERROR: thread attach failed
08-19 19:58:20.595: ERROR/AndroidRuntime(233): ERROR: thread attach failed
08-19 19:58:33.114: ERROR/AndroidRuntime(244): Uncaught handler: thread main exiting due to uncaught exception
08-19 19:58:33.165: ERROR/AndroidRuntime(244): android.app.SuperNotCalledException: Activity {com.mst.Splat/com.mst.Splat.GameTemplate} did not call through to super.onCreate()
08-19 19:58:33.165: ERROR/AndroidRuntime(244):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2461)
08-19 19:58:33.165: ERROR/AndroidRuntime(244):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
08-19 19:58:33.165: ERROR/AndroidRuntime(244):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)
08-19 19:58:33.165: ERROR/AndroidRuntime(244):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
08-19 19:58:33.165: ERROR/AndroidRuntime(244):     at android.os.Handler.dispatchMessage(Handler.java:99)
08-19 19:58:33.165: ERROR/AndroidRuntime(244):     at android.os.Looper.loop(Looper.java:123)
08-19 19:58:33.165: ERROR/AndroidRuntime(244):     at android.app.ActivityThread.main(ActivityThread.java:4363)
08-19 19:58:33.165: ERROR/AndroidRuntime(244):     at java.lang.reflect.Method.invokeNative(Native Method)
08-19 19:58:33.165: ERROR/AndroidRuntime(244):     at java.lang.reflect.Method.invoke(Method.java:521)
08-19 19:58:33.165: ERROR/AndroidRuntime(244):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
08-19 19:58:33.165: ERROR/AndroidRuntime(244):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
08-19 19:58:33.165: ERROR/AndroidRuntime(244):     at dalvik.system.NativeStart.main(Native Method)
 
ERROR/AndroidRuntime(244): android.app.SuperNotCalledException: Activity {com.mst.Splat/com.mst.Splat.GameTemplate} did not call through to super.onCreate()

Please don't use me as your code monkey. Just learn to read the logcat and google the error.

Your Class GameTemplate does not call it's super on the onCreate method. It tells you!

In eclipse press the big E button on the logcat window that will help you
 
I'm sorry, I really don't mean to use you as a "code monkey." I appreciate your helping me and trying to explain everything. I thought the problem was with the "Uncaught handler: thread main exiting due to uncaught exception," and I didn't know what that was. I'll make sure I look through everything before I post any more error logs.
 
Always just scan an exception log until you see your package name in this case "com.mst." then read the lines around that, they are the important thing
 
Back
Top Bottom