I have a Profile.class activity and it shows my photos, when clicking on it, opens a fragmentDialog showing the photo in slideshow ... but when deleting the photo, I need to go back to my profile and update my photos, running photos (myID);
How to do this, if possible?!
SlideshowDialogFragment.class
private void delete_photo(final String idPhoto){
pDialog.setMessage(getResources().getText(R.string.wait));
showDialog();
String tag = "deletePhoto";
pDialog.setMessage(getResources().getText(R.string.wait));
showDialog();
StringRequest req = new StringRequest(Request.Method.POST,
Config.DEL, new Response.Listener<String>() {
@Override
public void onResponse(String response) {
hideDialog();
try {
JSONObject jObj = new JSONObject(response);
boolean error = jObj.getBoolean("error");
if (!error) {
new Alert().MessageSuccess(getActivity(), view,
getText(R.string.delete_photo_success).toString());
// Voltar para meu Perfil.class e executar fotos(myID);
} else {
new Alert().MessageError(getActivity(), view,
getText(R.string.delete_photo_error).toString());
}
} catch (JSONException e) {
e.printStackTrace();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
new Alert().MessageError(getActivity(), view,
getText(R.string.error_connection).toString());
hideDialog();
}
}) {
@Override
protected Map<String, String> getParams() {
Map<String, String> params = new HashMap<String, String>();
params.put("me", myID);
params.put("id", idPhoto);
params.put("token", code);
return params;
}
};
CustomApplication.getInstance().addToRequestQueue(req, tag);
}