アクティビティから別のアクティビティに LinkedList を送信しようとしています。私が持っている最初のアクティビティで:
LinkedList<Class> codaActivity;
/* Lots of code here... */
Intent intent = new Intent(this, codaActivity.remove());
intent.putExtra("codaRedditi", codaActivity); // this is putExtra(String, Serializable)
startActivity(intent);
2番目のものでは、代わりに:
// The following throws a ClassCastException
codaRedditi=(LinkedList<Class>) (getIntent().getSerializableExtra("codaRedditi"));
アプリを実行しようとすると、DVM はそのコードが原因で ClassCastException をスローします (コードには絶対に存在しない ArrayList について話します! OO)
間違いは何ですか?