tenho a activity Perfil.class e la exibe minhas fotos, ao clicar nela, abre um fragmentDialog exibindo a foto em slideshow... mas ao deletar a foto, preciso q volte ao meu perfil e atualize as minhas fotos, executando fotos(myID);
Como fazer isso, se possivel?!
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);
}