I am getting an unchecked cast warning and I am not sure if it is safe to suppress it.
I am putting an ArrayList<Fragment>
inside a Bundle
. This Bundle is then put in my Intent as following:
Intent mIntent = new Intent(getBaseContext(),MySecondActivity.class);
Bundle myBundle = new Bundle();
myBundle.putSerializable("fragmentList",ArrayList<Fragment>);
mIntent.putExtras(myBundle);
startActivity(mIntent);
Then on my new activity (MySecondActivity) I am retrieving this data with the following code:
(ArrayList<Fragment>) getIntent().getSerializableExtra("fragmentList")
My compiler gives me the following warning:
" Unchecked cast: 'java.io.Serializable' to 'java.util.ArrayList' "
Everything is working fine though, am I right to say I can safely suppress it?
Thank you!