Start-Aktivität mit der Taste Android

Ive bekam ein problem. Ich möchten, öffnen Sie eine Aktivität mit einem Knopf, aber es stürzt dauernd ab.
So habe ich 2 Klassen und Eine Schaltfläche. Aber es stürzt immer ab.

  1. Klasse ist activity_home Klasse() und zweitens ist schedule_act () - Klasse.

activity_home Klasse:

    package my.action.bat;

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

    public class activity_home extends Activity {

        private Button ScheduleBtn;

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

             ScheduleBtn = (Button) findViewById(R.id.home_btn_schedule);

            ScheduleBtn.setOnClickListener(new View.OnClickListener() {

                public void onClick(View v) {
                    //TODO Auto-generated method stub


                    Intent myIntent = new Intent("my.action.bat.schedule_act");
                    startActivity(myIntent);


                }
            });
        }





    }  

schedule_act Klasse:

package my.action.bat;

    import android.app.Activity;
    import android.os.Bundle;

    public class schedule_act extends Activity {

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

            setContentView(R.layout.schedule_layout);
        }



    }

Android-Manifest:

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="my.action.bat"
        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:label="@string/app_name"
                android:name=".activity_home" >
                <intent-filter >
                    <action android:name="android.intent.action.MAIN" />

                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>

            <activity
                android:label="@string/app_name"
                android:name=".schedule_act" >
                <intent-filter >
                    <action android:name="my.action.bat.SCHEDULE_ACT" />

                    <category android:name="android.intent.category.DEFAULT" />
                </intent-filter>
            </activity>
        </application>

    </manifest>  

Danke Ihnen sehr.

Was ist die Ausnahme, die ausgelöst??

InformationsquelleAutor Ahmad | 2012-03-09

Schreibe einen Kommentar