Does anyone know any good resources where a beginner and understand Intents and Contexts. I understand the basics of activities, but i don’t really understand how Intents go along with this.
Also, anyone know any good resources to learn about passing information between activities? For example, I have a splash screen, and I have multiple levels for an addition activity. I created an addition activity, but i want to be able to press different buttons to determine different difficulties. So obviously I dont want to create like 5 different layouts with the same activity with just the difficulty changed. So since I already have the code for the addition activity, how can I pass data from the splash activity to the addition activity? The data might be an int that designates a difficulty level. I would then be able to access the int from the addition activity and base it off of that.
Thanks
You can easily pass Int between activities using Intents.
Activity1
Activity2
All primary datatypes Integer,Long,String,etc can be passed as an extra. Technically, anything that is
Serializablecan be an extra.Eg.
To retrieve it,