I am making an Android application that displays images and text with a laser.
I get data from json from the server. When I enter some data and the path to the images manually in the mysql database, then these images are displayed correctly in the application.
But when I take the image from the mobile camera and upload this image, it correctly inserts the path into the mysql database, but it does not appear in my application.
Can someone tell me why I have such a problem? I am not getting an error in my logcat.
Has anyone else had this problem? If so, how did you solve it? Please help me.
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.home_list); inboxList = new ArrayList<HashMap<String, String>>(); List<String> profile_photo = new ArrayList<String>(); List<String> userName = new ArrayList<String>(); List<String> place = new ArrayList<String>(); list=(ListView)findViewById(R.id.list); //adapter=new LazyAdapter(this, tS, mTitles); list.setAdapter(adapter); /********************************/ JSONObject json = userFunctions.homeData(); Log.e("Data", json.toString()); // Check your log cat for JSON reponse // Log.d("Inbox JSON: ", json.toString()); try { data = json.getJSONArray("data"); Log.d("inbox array: ", data.toString()); // looping through All messages for (int i = 0; i < data.length(); i++) { JSONObject c = data.getJSONObject(i); // Storing each json item in variable String uid = c.getString("uid"); String name = c.getString("name"); String success = c.getString("success"); String profile_img = c.getString("profile_photo"); //String date = c.getString(TAG_DATE); JSONObject places = c.getJSONObject(TAG_PLACES); String place_photo = places.getString(TAG_PLACE_IMG); Log.e("place_photo", place_photo); // creating new HashMap HashMap<String, String> map = new HashMap<String, String>(); // adding each child node to HashMap key => value map.put("uid", uid); map.put("name", name); map.put("success", success); map.put("profile_image", profile_img); profile_photo.add(profile_img); userName.add(name); place.add(place_photo); // adding HashList to ArrayList inboxList.add(map); } profile_image = new String[profile_photo.size()]; user_name = new String[userName.size()]; place_image = new String[(place.size())]; profile_photo.toArray(profile_image); userName.toArray(user_name); place.toArray(place_image); adapter = new LazyAdapter(this, profile_image, user_name, place_image); list.setAdapter(adapter); } catch (JSONException e) { e.printStackTrace(); } /*******************************/ }
Here is the lazy adapter class
public class LazyAdapter extends BaseAdapter { private Activity activity; private String[] data; private String[] name; private String[] place_photo; private static LayoutInflater inflater=null; public ImageLoader imageLoader; public LazyAdapter(Activity a, String[] d, String[] username, String[] place_image) { activity = a; data = d; name = username; place_photo = place_image;