开发者

why doesn't my 4th intent button work?

m i missing something? the first 3 work fine.

public void onClick(View v) {

switch (v.getId()) {
case R.id.hawknation_button:
   Intent i = new Intent(this, HawkNationRSS.class);
   startActivity(i);
   break;
   case R.id.hawkcentral_button:
   Intent i1 = new Intent(this, HawkCentralRSS.class);
  开发者_运维问答 startActivity(i1);
   break; 
   case R.id.hawkeyesports_button:
       Intent i2 = new Intent(this, HawkeyeSportsRSS.class);
       startActivity(i2);
       break;    
   case R.id.espn_button:
       Intent i3 = new Intent(this, HawkeyeSportsRSS.class);
       startActivity(i3);
       break;


 }


Try finishing previous activity(ies) in each case. Maybe they are invoking(or returning to) onResume() since you are calling same class and they are separate activities.


Seeing as the third and fourth cases are in essence identical and you're saying the other three work, make sure that R.id.espn_button is indeed the correct resource ID, and that you've set the onClick handler for that button as well.


Sorry, I should have done more digging before posting this. Forgot one critical line.

espn.setOnClickListener(this);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜