Luka Kunej
Luka Kunej

Reputation: 35

Problems starting intent

hello i have been searching for an answer on the web, but i can't find anything... i am pretty sure i'm doing everything right here so it could be a problem because i am using an emulator? Here is my code... I've also added the other activity to the manifest file...

package com.example.help;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class GlavniIzbornik extends Activity {

Button settings;
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_menu);
    settings = (Button)findViewById(R.id.bttnSettings);

    settings.setOnClickListener(new OnClickListener() {

        public void onClick(View v) {
            Intent settings = new Intent(GlavniIzbornik.this,TounamentSettings.class);
            GlavniIzbornik.this.startActivity(settings);
        }

    });
}

}

Manifest:

    <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.tournamentpro"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="17" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.example.tournamentpro.GlavniIzbornik"
            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.example.tournamentpro.TournamentSettings" ></activity>
    </application>

</manifest>

Upvotes: 0

Views: 186

Answers (1)

Blackbelt
Blackbelt

Reputation: 157457

All looks good. Rember that

  1. TounamentSettings has to extends Activity
  2. TounamentSettings has to be declared inside AndroidManifest.xml

Upvotes: 1

Related Questions