1. Download our Official Android App: Forums for Android!

Apps AHHHHHHH Please help!

Discussion in 'Android Development' started by matt20687, Feb 28, 2011.

  1. matt20687

    matt20687 Newbie
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    10
    Joined:
    Feb 23, 2011

    Feb 23, 2011
    10
    0
    15
    Hello,

    I am working on something that basically does the following:

    Opens a splash screen plays a little tune hangs for a couple of seconds and then goes onto a different screen which has two buttons and a little bit of text.

    It gets stuck when it tried to go onto the second screen, there are no error messages that i can see. There is one thing on my java code page for this screen that is crashing which says Source Not Found, the source attachment does not contain the source for the Activity.class.

    There is a button to change attached source but i havent a clue what to do.

    Any ideas?
     

    Advertisement

  2. jimthechimp

    jimthechimp Lurker
    Rank:
    None
    Points:
    6
    Posts:
    7
    Joined:
    Feb 11, 2011

    Feb 11, 2011
    7
    1
    6
    Sounds like you may have forgotten to add the new activity to the manifest. Go to manifest/Application tab and at the bottom is Application nodes, add the activity there.

    If you have done that, then I think you need to show code to help diagnose the problem.
     
  3. matt20687

    matt20687 Newbie
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    10
    Joined:
    Feb 23, 2011

    Feb 23, 2011
    10
    0
    15
    Hello,

    I have taken a look and it is in there unfortunately. My .xml code for my manifest is below.

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.cornboyz.thebasics"
    android:versionCode="1"
    android:versionName="1.0">
    <uses-sdk android:minSdkVersion="8" />

    <application android:icon="@drawable/icon" android:label="@string/app_name">
    <activity android:name=".myMain"
    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=".myMenu"
    android:label="@string/app_name">
    <intent-filter>
    <action android:name="com.cornboyz.thebasics.CLEARSCREEN" />
    <category android:name="android.intent.category.DEFAULT" />
    </intent-filter>
    </activity>
    <activity android:name=".tutorialOne"
    android:label="@string/app_name">
    <intent-filter>
    <action android:name="com.cornboyz.thebasics.TUTORIALONE" />
    <category android:name="android.intent.category.DEFAULT" />
    </intent-filter>
    </activity>
    </application>
    </manifest>


    ______________________________________________________________
    MY CODE FOR THE ONE THAT IS CRASHING
    ______________________________________________________________
    package com.cornboyz.thebasics;

    import android.app.Activity;
    import android.content.Intent;
    import android.media.MediaPlayer;
    import android.os.Bundle;
    import android.view.View;
    import android.widget.Button;

    public class myMenu extends Activity{

    MediaPlayer mpButtonClick;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    //set up the button sound
    final MediaPlayer mpButtonClick = MediaPlayer.create(this, R.raw.chimes);


    Button bTutorial1 = (Button) findViewById(R.id.tutorial1);
    bTutorial1.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
    // TODO Auto-generated method stub
    startActivity(new Intent("com.cornboyz.thebasics.TUTORIALONE"));
    mpButtonClick.start();
    }
    });


    }


    }
     
  4. matt20687

    matt20687 Newbie
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    10
    Joined:
    Feb 23, 2011

    Feb 23, 2011
    10
    0
    15
    Is there anything else anyone needs to help me with this?
     
  5. matt20687

    matt20687 Newbie
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    10
    Joined:
    Feb 23, 2011

    Feb 23, 2011
    10
    0
    15
    Hello,

    After looking into this using google it looks as though it is the JAR file that is causing me problem. I have the following error. Can anyone translate this into english?

    // Compiled from View.java (version 1.5 : 49.0, no super bit)
    public abstract static interface android.view.View$OnClickListener {

    // Method descriptor #4 (Landroid/view/View;)V
    public abstract void onClick(android.view.View arg0);

    Inner classes:
    [inner class info: #1 android/view/View$OnClickListener, outer class info: #7 android/view/View
    inner name: #9 OnClickListener, accessflags: 1545 public abstract static]
    }
     
  6. idavis

    idavis Newbie
    Rank:
    None
    Points:
    16
    Posts:
    27
    Joined:
    Feb 11, 2011

    Feb 11, 2011
    27
    4
    16
    You might have to extend your main class:

    public class myMenu extends Activity{

    might have to be

    public class myMenu extends myMain{
     
  7. matt20687

    matt20687 Newbie
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    10
    Joined:
    Feb 23, 2011

    Feb 23, 2011
    10
    0
    15
    I seem to have fiddled too much. I have somehow lost my source folder in the package explorer and my code is now showing error messages. How can i get them back?
     

Share This Page

Loading...