2012-04-27 6 views
0

私が作成しているアプリケーションでは、スプラッシュ画面の後に戻るホームメニュー画面で、いずれかのボタンをクリックすると何も起こりません。私は問題が何かを知らないのですか?ここで新しいインテントがボタンクリックで開始しない

がSRCファイルである、それはView.OnClickListenerを実装します。

@Override 
public void onClick(View v) { 
    // TODO Auto-generated method stub 
    switch (v.getId()) { 
    case R.id.bPlay: 
     Intent ourIntentPlay = new Intent(PartyActivity.this, Play.class); 
     startActivity(ourIntentPlay); 
     break; 
    case R.id.bFacts: 
     Intent ourIntentFacts = new Intent(PartyActivity.this, Facts.class); 
     startActivity(ourIntentFacts); 
     break; 
    case R.id.bInfo: 
     Intent ourIntentInfo = new Intent(PartyActivity.this, Info.class); 
     startActivity(ourIntentInfo); 
     break; 
    case R.id.bHelp:  
     Intent ourIntentHelp = new Intent(PartyActivity.this, Help.class); 
     startActivity(ourIntentHelp); 
     break; 
    } 
} 

そしてここでは、アプリケーションタグ内のマニフェスト、次のとおりです。

<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=".PartyActivity" 
     android:label="@string/app_name" 
     android:screenOrientation="portrait" > 
     <intent-filter> 
      <action android:name="w.m.PARTYACTIVITY" /> 

      <category android:name="android.intent.category.DEFAULT" /> 
     </intent-filter> 
    </activity> 
    <activity 
     android:name=".Info" 
     android:screenOrientation="portrait" > 
     <intent-filter> 
      <action android:name="w.m.INFO" /> 

      <category android:name="android.intent.category.DEFAULT" /> 
     </intent-filter> 
    </activity> 
    <activity 
     android:name=".Play" 
     android:screenOrientation="portrait" > 
     <intent-filter> 
      <action android:name="w.m.PLAY" /> 

      <category android:name="android.intent.category.DEFAULT" /> 
     </intent-filter> 
    </activity> 
    <activity 
     android:name=".Help" 
     android:screenOrientation="portrait" > 
     <intent-filter> 
      <action android:name="w.m.HELP" /> 

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

おかげ

答えて

3

あなたは割り当てますあなたのボタンにリスナー?あなたのonCreate()方法でこれを行います。

findViewById(R.id.bPlay).setOnClickListener(clickListener); 

あなたの活動がOnClickListenerを実装している場合、clickListenerthisになります。すべてのボタンでこれを行います。

+0

これは私が忘れていたものです。ありがとうございます。 – bluestunt

関連する問題