Like I said in the title, I want to send data from an activity to a fragment, but the fragment needs to use the data received when it is created, not after a button is pressed like usual. The activity that puts the values in the bundle is the one before the activity that calls the fragment, so that the bundle is already filled when the fragment is called.
From my research the best way to do this is using a bundle, but when I do String data = bundle.getString("value")
, I get a null pointer exception, meaning the bundle is empty, but I already checked and the values are there. How do I fix this?