I am creating an application in which I am using the ImageLoading Framework for Dowloading images from a server. Put the URLs in the cache ... Now I want to update the user profile image, but even after updating the profile pic on the server does not appear in the application. The application shows the user's old Pic profile. Why is this problem occurring and how can I fix it? Please help as soon as possible. Also post links if this is helpful to me.
Thanks in advance!
to update onclick:
update_profile_pic.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { v.performHapticFeedback(HapticFeedbackConstants.KEYBOARD_TAP); String value_for_test="delete"; Toast.makeText(getBaseContext(), "it works", Toast.LENGTH_SHORT).show(); Intent i=new Intent(getApplicationContext(),ProfilePictureCaptureHomeActivity.class); i.putExtra("image",value_for_test); startActivity(i);
Pic CaptureHome Profile
DBAdapter db = new DBAdapter(getApplicationContext()); db.open(); if (null == phoneNumber) { Cursor c = db.getUserInfo(); phoneNumber = c.getString(0); imageUrl = c.getString(1); System.out.println("the imageUrl is"+imageUrl); c.close(); } setContentView(R.layout.profilepic_capture); if (null == imageUrl) { Cursor imageUrlObj = db.getUserInfo(); imageUrl = imageUrlObj.getString(1); System.out.println("the imageurl is"+imageUrl); imageUrlObj.close(); } db.close();
To update the profile picture:
if(image!=null){ Toast.makeText(getApplicationContext(), "Redirected", Toast.LENGTH_LONG).show(); imageUrl=null; } if(imageUrl != null) { Intent uploadimg = new Intent(ProfilePictureCaptureHomeActivity.this,ListeningAndSharingHomeActivity.class); uploadimg.putExtra("phoneNumber", phoneNumber); startActivity(uploadimg); } else { Log.v("ProfilePictureCaptureHomeActivity", "Staying Here"); } _gallerybutton = (ImageButton) findViewById(R.id.btn_gallery); _photobutton = (ImageButton) findViewById(R.id.btn_photo); System.out.println("here in popup phoneeeeee" + phoneNumber); System.out.println("here in flag************" + firstUpload); _gallerybutton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { v.performHapticFeedback(HapticFeedbackConstants.KEYBOARD_TAP); System.out.println("here in galleryyyyyyyyyy"); Intent uploadimg = new Intent(ProfilePictureCaptureHomeActivity.this,ProfilePicFromGallery.class); uploadimg.putExtra("phoneNumber", phoneNumber); startActivity(uploadimg); } }); _photobutton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { v.performHapticFeedback(HapticFeedbackConstants.KEYBOARD_TAP); System.out.println("here in take piccccc"); Intent capIntent = new Intent(ProfilePictureCaptureHomeActivity.this,ProfilePicFromCamera.class); startActivity(capIntent); } });
source share