Note that there are some explanatory texts on larger screens.

plurals
  1. PONot able to display the Next activity when the button is clicked [Android]
    primarykey
    data
    text
    <p>I've been trying to get my button's to work for a very long time now, the funny thing is they I've implemented exactly the code exactly the same way for other buttons and they work fine, the buttons are not even throwing an errors or exceptions, and I'm getting tired.. I've tried pretty much everything I can think of but it still is not working. </p> <p>The code for the activity where the buttons aren't working. </p> <pre><code> @Override protected void onCreate(Bundle savedInstanceState) { Button easy, medium, hard; requestWindowFeature(Window.FEATURE_NO_TITLE); super.onCreate(savedInstanceState); setContentView(R.layout.exam_level_options); easy = (Button) findViewById(R.id.easyExamButn); medium = (Button) findViewById(R.id.mediumExamButn); hard = (Button) findViewById(R.id.hardExamButn); easy.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub intent = new Intent (ExamOptionPage.this, EasyExam.class); startActivity(intent); } }); medium.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub intent = new Intent (ExamOptionPage.this, MediumExam.class); startActivity(intent); } }); hard.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub intent = new Intent (ExamOptionPage.this, HardExam.class); startActivity(intent); } }); } /*@Override public void onClick(View v) { switch (v.getId()){ case R.id.easyExamButn: intent = new Intent(this, EasyExam.class); this.startActivity(intent); overridePendingTransition(R.anim.fade, 0); break; case R.id.mediumExamButn: intent = new Intent(this, MediumExam.class); this.startActivity(intent); overridePendingTransition(R.anim.fade, 0); break; case R.id.hardExamButn: intent = new Intent(this, HardExam.class); this.startActivity(intent); overridePendingTransition(R.anim.fade, 0); break; default: break; } }*/ </code></pre> <p>I've block commented out the switch statement, but and tried the other method still not luck, however the switch statement works for other activities. Doing exactly the same thing. </p> <p>The log:</p> <pre><code>01-08 23:42:39.436: INFO/ActivityManager(58): Starting activity: Intent { act=com.gc02.android.activities.OPTIONACTIVITY cmp=com.gc02.android/.activities.OptionActivity } 01-08 23:42:39.464: INFO/WindowManager(58): Setting rotation to 0, animFlags=0 01-08 23:42:39.514: INFO/ActivityManager(58): Config changed: { scale=1.0 imsi=310/260 loc=en_US touch=3 keys=2/1/2 nav=3/1 orien=1 layout=34} 01-08 23:42:40.035: INFO/ActivityManager(58): Displayed activity com.gc02.android/.activities.OptionActivity: 576 ms (total 576 ms) 01-08 23:42:41.234: INFO/ActivityManager(58): Starting activity: Intent { cmp=com.gc02.android/.activities.ExamActivity } 01-08 23:42:41.614: INFO/ActivityManager(58): Displayed activity com.gc02.android/.activities.ExamActivity: 358 ms (total 358 ms) 01-08 23:42:42.144: DEBUG/dalvikvm(58): GC freed 1726 objects / 84336 bytes in 104ms 01-08 23:42:43.474: WARN/KeyCharacterMap(1638): No keyboard for id 0 01-08 23:42:43.484: WARN/KeyCharacterMap(1638): Using default keymap: /system/usr/keychars/qwerty.kcm.bin 01-08 23:42:46.694: DEBUG/dalvikvm(101): GC freed 551 objects / 26640 bytes in 75ms 01-08 23:42:47.584: DEBUG/dalvikvm(96): GC freed 411 objects / 22256 bytes in 116ms 01-08 23:42:48.054: DEBUG/dalvikvm(96): GC freed 719 objects / 53216 bytes in 166ms 01-08 23:42:51.114: DEBUG/dalvikvm(96): GC freed 693 objects / 42344 bytes in 70ms 01-08 23:42:59.134: INFO/NotificationService(58): enqueueToast pkg=com.gc02.android callback=android.app.ITransientNotification$Stub$Proxy@44c476a8 duration=0 01-08 23:43:01.688: DEBUG/dalvikvm(99): GC freed 12471 objects / 573368 bytes in 1422ms 01-08 23:43:03.124: WARN/InputManagerService(58): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@44c870a0 </code></pre> <p>It would seem that the buttons are not being called, when I click them, what can I do?</p> <p>Thanks Guys!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload