good day ma'am/sir
I need some help of how to fetch the image from database and display it to my ImageView
private void getSqlDetails() {
final String url= "You do not have permission to view the full content of this post. Log in or register now."+getUser;
pd.show();
StringRequest stringRequest = new StringRequest(Request.Method.GET,
url,
new Response.Listener<String>() {
Override
public void onResponse(String response) {
pd.hide();
try {
JSONArray jsonarray = new JSONArray(response);
for(int i=0; i < jsonarray.length(); i++) {
JSONObject jsonobject = jsonarray.getJSONObject(i);
String name=jsonobject.getString("image_name");
String imageURL=jsonobject.getString("image_path");
result.setText(name);
}
} catch (JSONException e) {
e.printStackTrace();
}
}
},
new Response.ErrorListener() {
Override
public void onErrorResponse(VolleyError error) {
if(error != null){
//Never mind this below
// Toast.makeText(getApplicationContext(), "Something went wrong.", Toast.LENGTH_LONG).show();
}
}
}
);
I need some help of how to fetch the image from database and display it to my ImageView
private void getSqlDetails() {
final String url= "You do not have permission to view the full content of this post. Log in or register now."+getUser;
pd.show();
StringRequest stringRequest = new StringRequest(Request.Method.GET,
url,
new Response.Listener<String>() {
Override
public void onResponse(String response) {
pd.hide();
try {
JSONArray jsonarray = new JSONArray(response);
for(int i=0; i < jsonarray.length(); i++) {
JSONObject jsonobject = jsonarray.getJSONObject(i);
String name=jsonobject.getString("image_name");
String imageURL=jsonobject.getString("image_path");
result.setText(name);
}
} catch (JSONException e) {
e.printStackTrace();
}
}
},
new Response.ErrorListener() {
Override
public void onErrorResponse(VolleyError error) {
if(error != null){
//Never mind this below
// Toast.makeText(getApplicationContext(), "Something went wrong.", Toast.LENGTH_LONG).show();
}
}
}
);