mercredi 23 janvier 2019

How do i pass the value of a CheckBox to another activity?

I am very new to this, and there is probably a simple solution, but i've been trying for two days and can't figure it out. thus my first ever post:

I have two activities. In the first activity there's a CheckBox. If that CheckBox is clicked i want a TextView in my second activity to display a text when i press a Button. Whenever i press that button, the app crashes. I have tried using different Intent variations to pass the CheckBox value to the second actiity. Also, i have tried putting the CheckBox in the same activity as the TextView and Button, and that works fine, but the CheckBox has to be in another activity. Is there a simple solution i am not seeing?

Also, i don't want to use StartActivity(). I just want the Button in my first activity to know if the CheckBox in my second activity is ticked.

Thanks for any advice!




Aucun commentaire:

Enregistrer un commentaire