1
have the Activity Profile.class and it displays my photos, when clicking on it, opens a fragmentDialog displaying the photo in slideshow... but when deleting the photo, need q 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);
}
I didn’t understand step 3 and 4... I created the Photosrefreshmyprofile interface and in the Profile I used Photosrefreshmyprofile. Also in Profile I created the method @Override public void reply() { photos(myID); } this right here ?
– Jonathan Silva
I did, thank you very much :)
– Jonathan Silva