i try obfuscate my code of android app with ProGuard
. But after this my app give exception at running:
11-15 01:46:26.818: W/System.err(21810)
This issue can be solved by using a different way to create the TypeToken
instance (for the parameterized type Map
):
Type collectionType =
TypeToken.get(
$Gson$Types.newParameterizedTypeWithOwner(null,
Map.class, Integer.class, WatchedEpisodes.class)).getType();
The next version of gson (I assume 2.8), will allow you to type this more easily:
Type collectionType =
TypeToken.getParameterized(Map.class,
Integer.class,
WatchedEpisodes.class).getType();