Communicating between two threads, I use a Message, transporting the data. In my case, a HashMap. Now on reconstructing the data, I get a warning about an unchecked type cast. That would imply to me (as java noob), that I shouldn’t do that cast at all, right? But what would be the correct way to get the HashMap out of the bundle?
Bundle dataBundle = msg.getData();
Serializable result = dataBundle.getSerializable("data");
HashMap<String,String> output = (HashMap<String, String>) result;
Thanx for any pointers!
Marcus
So with your approach
there is no way to do it without casting because
getSerializablemethod always returnsSerializableinstance.Without casting you could use
getParcelableExtrathat returnsTbut i know anything about your application context so i’m not sure if it’s possible to use.