I need your help, I cannot understand what's happening?
I'm trying to send a TreeMap between 2 activities, the code is something like this:
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
}
}
This returns to me HashMap cannot be cast to TreeMap. What