I’m getting errors upon start of my activities, and i’ve been unable to find the solution so far, is there by any chance anyone who could help me troubleshooting my code?
SPLASH:
package inno.games;
import android.app.Activity;
import android.content.Intent;
import android.media.MediaPlayer;
import android.os.Bundle;
public class Splash extends Activity{
MediaPlayer ourSong;
@Override
protected void onCreate(Bundle Jonas) {
// TODO Auto-generated method stub
super.onCreate(Jonas);
setContentView(R.layout.splash);
ourSong = MediaPlayer.create(Splash.this, R.raw.splashsound);
ourSong.start();
Thread timer = new Thread(){
public void run(){
try{
sleep(5000);
} catch (InterruptedException e){
e.printStackTrace();
}finally{
Intent introscreenactivity = new Intent("Inno.Games.INTROSCREEN");
startActivity(introscreenactivity);
}
}
};
timer.start();
}
@Override
protected void onPause() {
// TODO Auto-generated method stub
super.onPause();
ourSong.release();
finish();
}
}
An error appears upon initialization of the next activity.
CODE FOR NEXT ACTIVITY
(which i want to start a new activity on buttonclick)
package inno.games;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.EditText;
public class Introscreen extends Activity {
Button proceed;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.intro);
proceed = (Button) findViewById(R.id.bProceed);
proceed.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
Intent myIntent = new Intent(Introscreen.this, BillardScoreboardActivity.class);
Introscreen.this.startActivity(myIntent);
}
});
}
THIS IS MY MANIFEST:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="inno.games"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name=".Splash"
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=".Intro"
android:label="@string/app_name" >
<intent-filter>
<action android:name="Inno.Games.INTROSCREEN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".BillardScoreboardActivity"
android:label="@string/app_name" >
</activity>
</application>
SPLASH is obv splash screen
IINTROSCREEN is the activity following splash
And BILLARDSCOREBOARDACTIVITY is the activity i want to start uppon buttonclick on introscreen GUI.
You need to correct this part:
with this:
What is wrong actually?
You haven’t declared activity with its exact name that you have created. You have given only .Intro instead of .Introscreen