あなたの助けが必要です。何が起こっているのか理解できません。
2 つのアクティビティ間で TreeMap を送信しようとしています。コードは次のようになります。
class One extends Activity{
public void send(){
Intent intent = new Intent(One.this, Two.class);
TreeMap<String, String> map = new TreeMap<String, String>();
map.put("1","something");
intent.putExtra("map", map);
startActivity(intent);
finish();
}
}
class Two extends Activity{
public void get(){
(TreeMap<String, String>) getIntent().getExtras().get("map");//Here is the problem
}
}
これは私に戻ります HashMap は TreeMap にキャストできません。何