1
私は奇妙な種類の問題を抱えています。イメージをフォルダにアップロードして、データベース内の名前(ユーザーのID)と拡張子を保存して、私はSharedPrefMangerを編集していますが、画像の名前と拡張子を保存していますが、フォルダー内の画像は変更されません。ここMySQLからのAndroidイメージリクエスト
はここ
public boolean uploadpicmanager(String id){
SharedPreferences sharedPreferences3 = mCtx.getSharedPreferences(SHARED_PREF_NAME,Context.MODE_PRIVATE);
SharedPreferences.Editor editor3 = sharedPreferences3.edit();
editor3.putString(KEY_IMAGE,id);
editor3.apply();
return true;
}
イメージ名を変更uploadpicmanはイムは画像を読み取る方法ですされてどのようにImはフォルダ内の画像を変更し、
その作業罰金String uploadId = UUID.randomUUID().toString();
String path = getPath(filepath);
try {
new MultipartUploadRequest(this,uploadId,Constants.URL_UPLOADPIC)
.addFileToUpload(path,"image")
.addParameter("id",SharedPrefManager.getInstance(this).getKeyUserId())
.setNotificationConfig(new UploadNotificationConfig())
.setMaxRetries(2)
.startUpload();
String extention = path.substring(path.lastIndexOf("."));
String id = SharedPrefManager.getInstance(getApplicationContext()).getKeyUserId();
SharedPrefManager.getInstance(getApplicationContext()).uploadpicmanager(id+extention);
Toast.makeText(Profile.this, path, Toast.LENGTH_LONG).show();
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (FileNotFoundException e) {
e.printStackTrace();
}
ここで、最初のアップロードのためのその作業の罰金しかし、私は写真を変更するときに変更されません。私がどこにいるのか分からないのですが、
Picasso.with(getApplicationContext())
.load("http://hello.000webhostapp.com/Shop&Go/customers/"+
SharedPrefManager.getInstance(getApplicationContext()).getKeyImage())
.into(profilepic);
方法のメモリポリシーを解決できませんか? –
Picasa.with(getApplicationContext()) .load( "http://hello.000webhostapp.com/Shop&Go/customers/" + SharedPrefManager.getInstance(getApplicationContext())。getKeyImage())。memoryPolicy(MemoryPolicy.NO_CACHE ).into(profilepic); –