Is it possible to pass Calendar Objects from one Activtity to another with intents? I get true for the hasExtra("startDate") but i cannot get the Object itself... sorry for the beginner question.
// Activity Two
Intent resultIntent = new Intent();
resultIntent.putExtra("endDate", endDate);
resultIntent.putExtra("startDate", endDate);
setResult(AppCompatActivity.RESULT_OK, resultIntent);
//Activity One
Bundle newText = data.getExtras();
data.hasExtra("startDate")); // returns true
newText.get("startDate") // returns null
Assuming that you mean java.util.Calendar, that implements Serializable, so you can use putExtra() and getSerializableExtra().
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With