java - Warning with List<String> on Android -


i want solve warning. in part of code have warning: type safety: unchecked cast object list<string>

string preferences = pprefs.getstring(sharedpreferences);     objectmapper mapper = new objectmapper();                 byte[] bytetemp = mapper.readvalue(preferences, byte[].class);                 bytearrayinputstream in = new bytearrayinputstream(bytetemp);                 objectinputstream = new objectinputstream(in);     list<string> numbers = (list<string>) is.readobject(); 

how can do? thank all.

objectinputstream::readobject returns object.

readobject

you casting list<string> without first checking if list<string>. far compiler knows, can kind of object (a string, integer, , on...)


Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

visual studio 2010 - Connect to informix database windows form application -

android - Associate same looper with different threads -