Hello I am new to android and I have a problem I do not know how to solve. I have 3 activities, ActivityMain, ActivityA and ActivityB. ActivityMain is the start activity. From ActivityMain the user can move to ActivityA, when they do that a value is passed from ActivityMain to ActivityA like this:
Intent i = new Intent(context, ActivityA.class); i.putExtra("eventId", eventId); startActivity(i); And in my onCreate method of ActivityA I have an init() function that gets that value like this:
public void init() { this.eventId = Integer.parseInt(getIntent().getExtras().get("eventId").toString()); } Now this is my issue, for some reason when I navigate from ActivityA to ActivityB then I click back my app stops working a Null Pointer Exception is thrown at the above line of code.