Passing data through Intent and receiving it

前端 未结 2 1407
無奈伤痛
無奈伤痛 2020-12-06 03:48

I am trying to pass data through my Intent into the next activity so I can receive it and give a timer values.

Button TimerButton = (Button)findViewById(R.id         


        
2条回答
  •  一整个雨季
    2020-12-06 04:27

    You need to put this line:

    int beefType = getIntent().getIntExtra("beefType", 200);
    

    in the onCreate method and not as a field initializer.

    And next time - read the stacktrace before asking. If you are still stuck after reading it, attach it to youyr questioin as well.

    Good Luck!

提交回复
热议问题