In order not to have to redo requests that have already been brought from the server, I persist them using SharedPreferences ... Only they are created dynamically in my app. example:
// essa key é unica para cada post
// ex: MINHA_KEI_1, depois MINHA_KEI_2, e assim por diante...
SharedPreferences save = contexto.getSharedPreferences(key, Context.MODE_PRIVATE);
SharedPreferences.Editor saveEdit = save.edit();
Gson gson = new Gson();
String jsonPost = gson.toJson(posts);
saveEdit.putString("POST", jsonPost);
saveEdit.commit();
Except after a while, I want to delete all of them for the hand app to get very large.
How do I delete all of them at once, even without knowing the KEY?
I thought of creating a sharedPreferences with the generated keys, and then go through each one and delete ... I do not know if there is any other way.