private static String encrypt(Context cont, String value) {
try {
return Base64.encodeToString(value.getBytes(), Base64.DEFAULT);
}
catch (IllegalArgumentException e) {
// TODO: handle exception
}
catch (Exception e) {
throw new RuntimeException(e);
}
}
private static String decrypt(Context cont, String value) {
try {
return new String(Base64.decode(value, Base64.DEFAULT));
}
catch (IllegalArgumentException e) {
// TODO: handle exception
}
catch (Exception e) {
throw new RuntimeException(e);
}
}
add illegal argument exception catch .....
I hope it will work