Android 毕加索,图像视图没有刷新

Android 毕加索,图像视图没有刷新,android,picasso,Android,Picasso,我正在使用毕加索库将图像加载到图像视图中,第一次它工作正常,但之后如果我返回并进行一些更改,它会再次重复相同的图像,并再次启动带有图像的活动。url始终是相同的,我搜索并应用了许多更改。它不工作,请帮助 同时,当我关闭应用程序并重新启动时,它也不会刷新,当我点击浏览器上的url时,它会显示更新后的图像 Picasso.with(this) .load(Config.API_URL+"/sites/default/files/"+uiidd+".png"

我正在使用毕加索库将图像加载到图像视图中,第一次它工作正常,但之后如果我返回并进行一些更改,它会再次重复相同的图像,并再次启动带有图像的活动。url始终是相同的,我搜索并应用了许多更改。它不工作,请帮助

同时,当我关闭应用程序并重新启动时,它也不会刷新,当我点击浏览器上的url时,它会显示更新后的图像

          Picasso.with(this)
            .load(Config.API_URL+"/sites/default/files/"+uiidd+".png")
            .memoryPolicy(MemoryPolicy.NO_CACHE)
            .networkPolicy(NetworkPolicy.NO_CACHE)
            .into(imageView); 






     public class Activity_result extends AppCompatActivity {
    Toolbar toolbar;
    private ImageView imageView;
    String uiidd;

    Button testagain_btn;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_result);

        imageView = (ImageView) findViewById(R.id.imageView_chart);
        toolbar = (Toolbar) findViewById(R.id.tool_barresult);
        testagain_btn=(Button)findViewById(R.id.btn_testagain);



        setSupportActionBar(toolbar);
        uiidd = MyApplication.getInstance().getUid();
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
            getWindow().setStatusBarColor(getResources().getColor(R.color.color_darkgreen));
        }

       Picasso.with(this)
                .load(Config.API_URL+"/sites/default/files/"+uiidd+".png")
                .into(imageView);
      /*  new Thread(new Runnable() {
            @Override
            public void run() {
                Glide.get(Activity_result.this).clearDiskCache();
            }
        }).start();

      Glide.with(this)
                .load(Config.API_URL+"/sites/default/files/"+uiidd+".png")
              .skipMemoryCache(true)
              .diskCacheStrategy(DiskCacheStrategy.NONE)
              //.signature(new StringSignature(System.currentTimeMillis()))
              .into(imageView);*/

        resultjsonrequest();
     testagain_btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
               /* Intent i = new Intent(Activity_result.this,Activity_knowStatus.class);
                startActivity(i);*/

                final Dialog dialog = new Dialog(Activity_result.this);
                dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
                dialog.setContentView(R.layout.custom_dialoghealthdata);

                dialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));

                ImageView dialogButtonCancel = (ImageView) dialog.findViewById(R.id.imageView_close);
                Button dialogButtonOk = (Button) dialog.findViewById(R.id.btn_ok);
                // Click cancel to dismiss android custom dialog box
                dialogButtonCancel.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        dialog.dismiss();
                    }
                });

                // Your android custom dialog ok action
                // Action for custom dialog ok button click
                dialogButtonOk.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        Intent i = new Intent(Activity_result.this,Activity_knowStatus.class);
                        startActivity(i);
                    }
                });

                dialog.show();






            }
        });




    }

    @Override
    protected void onResume() {
        super.onResume();
        Picasso.with(this)
                .load(Config.API_URL+"/sites/default/files/"+uiidd+".png")
                .into(imageView);
    }

    /* @Override
    public void onBackPressed()
    {

finish();

    }*/

    private void resultjsonrequest() {

        Util.showProDialog(Activity_result.this,"Loading....");

        JsonObjectRequest jsonObjReq = new JsonObjectRequest(Request.Method.GET,
                Config.API_URL+"/profile-result-json?userProfileID="+uiidd+"", null, new Response.Listener<JSONObject>() {

            @Override
            public void onResponse(JSONObject response) {


                try {

                    String txt_totalscore1 = response.getString("patient_score");
                    txtvw_totalscore.setText(txt_totalscore1);

                    String txt_chol1 = response.getString("Cholesterol");
                    txt_chol.setText(txt_chol1);
                    String cholcolor = response.getString("cholesterolPointColor");
                    linear_chol.setBackgroundColor(Color.parseColor(cholcolor));

                    String txt_trigly1 = response.getString("Triglycerides");
                    txt_trigly.setText(txt_trigly1);
                    String triglycolor = response.getString("triglycerideScoreColor");
                    linear_trigly.setBackgroundColor(Color.parseColor(triglycolor));

                    String txt_hdlchol1 = response.getString("HDLCholesterol %");
                    txt_hdl_chol.setText(txt_hdlchol1);
                    String hdlchl1color = response.getString("hDL_cholesterol_scoreColor");
                    linear_hdl_chol.setBackgroundColor(Color.parseColor(hdlchl1color));

                    String txt_sysbp1 = response.getString("SystolicBP");
                    txt_systolicbp.setText(txt_sysbp1);
                    String systoiccolor = response.getString("systolic_bp_scoreColor");
                    linear_systolicbp.setBackgroundColor(Color.parseColor(systoiccolor));

                    String txt_disys1 = response.getString("DiastolicBP");
                    txt_disystolicbp.setText(txt_disys1);
                    String disyscolor = response.getString("diastolic_bp_scoreColor");
                    linear_disystolicbp.setBackgroundColor(Color.parseColor(disyscolor));

                    String txsugarf1 = response.getString("Blood Sugar Fasting (FF)");
                    txt_bloodsugarff.setText(txsugarf1);
                    String sugarfcolor = response.getString("bl_glucode_ff_scoreColor");
                    linear_bloodsugarff.setBackgroundColor(Color.parseColor(sugarfcolor));


                    String txsugarp1 = response.getString("Blood Sugar (PP)");
                    txt_bloodsugarpp.setText(txsugarp1);
                    String sugarpcolor = response.getString("bl_glucose_pp_scoreColor");
                    linear_bloodsugarpp.setBackgroundColor(Color.parseColor(sugarpcolor));

                    String txsmoking1 = response.getString("Smoking");
                    txt_smoking.setText(txsmoking1);
                    String smokingcolor = response.getString("Smoking_ScoreColor");
                    linear_smoking.setBackgroundColor(Color.parseColor(smokingcolor));


                    String txbmi = response.getString("BMI");
                    txt_bmi.setText(txbmi);
                    String bmicolor = response.getString("BMI_ScoreColor");
                    linear_bmi.setBackgroundColor(Color.parseColor(bmicolor));

                    String txwalking1 = response.getString("Walking");
                    txt_walking.setText(txwalking1);
                    String walkingcolor = response.getString("walkingPointColor");
                    linear_walking.setBackgroundColor(Color.parseColor(walkingcolor));

                    String txt_oil1 = response.getString("Oil Intake");
                    txt_oil.setText(txt_oil1);
                   String oilcolor = response.getString("oil_ghee_intake_scoreColor");
                   linear_oil.setBackgroundColor(Color.parseColor(oilcolor));


                    String txmilk1 = response.getString("MilkDairy Intake");
                    txt_milk.setText(txmilk1);
                    String milkcolor = response.getString("milk_dairy_intake_scoreColor");
                    linear_milk.setBackgroundColor(Color.parseColor(milkcolor));

                    String txfruit1 = response.getString("Fruits Intake");
                    txt_fruit.setText(txfruit1);
                    String fruitcolor = response.getString("Vegitable_ScoreColor");
                    linear_fruit.setBackgroundColor(Color.parseColor(fruitcolor));

                    String txt_vegetable1 = response.getString("Vegetables Intake");
                    txt_vegetable.setText(txt_vegetable1);
                    String vegetablecolor = response.getString("vegetable_you_intake_scoreColor");
                    linear_vegetable.setBackgroundColor(Color.parseColor(vegetablecolor));

                    String txnonveg1 = response.getString("Animal Food");
                    txt_nonveg.setText(txnonveg1);
                    String nonvegcolor = response.getString("intake_non_veg_scoreColor");
                    linear_nonveg.setBackgroundColor(Color.parseColor(nonvegcolor));

                    String txyoga1 = response.getString("Yoga");
                    txt_yoga.setText(txyoga1);
                    String yogacolor = response.getString("yoga_or_stretching_exercis_scoreColor");
                    linear_yoga.setBackgroundColor(Color.parseColor(yogacolor));

                    String txmeditation1 = response.getString("MeditationPranayam");
                    txt_meditation.setText(txmeditation1);
                    String meditationcolor = response.getString("meditation_prayer_scoreColor");
                    linear_meditation.setBackgroundColor(Color.parseColor(meditationcolor));

                    String txstress1 = response.getString("Stress Management");
                    txt_stress.setText(txstress1);
                    String stresscolor = response.getString("stress_mgmt_scoreColor");
                    linear_stress.setBackgroundColor(Color.parseColor(stresscolor));






                } catch (JSONException e) {
                    e.printStackTrace();
                    Util.showMessageDialog(Activity_result.this, "Server error! Try Again");
                }
                Util.dimissProDialog();
            }
        }, new Response.ErrorListener() {

            @Override
            public void onErrorResponse(VolleyError error) {
               Util.dimissProDialog();
                Util.showMessageDialog(Activity_result.this, "Server error! Try Again");
            }
        });
        jsonObjReq.setRetryPolicy(new DefaultRetryPolicy(
                10000,
                DefaultRetryPolicy.DEFAULT_MAX_RETRIES,
                DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));

        // Adding request to request queue
       // MyApplication.getInstance().addToRequestQueue(jsonObjReq);
        RequestQueue requestQueue = Volley.newRequestQueue(this);
        requestQueue.add(jsonObjReq);
    }






}
Picasso.with(这个)
.load(Config.API_URL+“/sites/default/files/”+uiidd+“.png”)
.memoryPolicy(memoryPolicy.NO_缓存)
.networkPolicy(networkPolicy.NO\u缓存)
.进入(图像视图);
公共类活动\u结果扩展了AppCompatActivity{
工具栏;
私人影像视图;
字符串uiidd;
按钮测试增益(btn);
@凌驾
创建时受保护的void(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity\u结果);
imageView=(imageView)findViewById(R.id.imageView\U图表);
工具栏=(工具栏)findViewById(R.id.tool\u barresult);
testagain\u btn=(按钮)findViewById(R.id.btn\u testagain);
设置支持操作栏(工具栏);
uiidd=MyApplication.getInstance().getUid();
if(Build.VERSION.SDK\u INT>=Build.VERSION\u code.LOLLIPOP){
getWindow().addFlags(WindowManager.LayoutParams.FLAG\u DRAWS\u SYSTEM\u BAR\u BACKGROUNDS);
getWindow().setStatusBarColor(getResources().getColor(R.color.color_darkgreen));
}
毕加索。用(这个)
.load(Config.API_URL+“/sites/default/files/”+uiidd+“.png”)
.进入(图像视图);
/*新线程(newrunnable()){
@凌驾
公开募捐{
Glide.get(Activity_result.this).clearDiskCache();
}
}).start();
用(这个)滑翔
.load(Config.API_URL+“/sites/default/files/”+uiidd+“.png”)
.skipMemoryCache(真)
.diskCacheStrategy(diskCacheStrategy.NONE)
//.signature(新的StringSignature(System.currentTimeMillis()))
.进入(图像视图)*/
resultjsonrequest();
testagain_btn.setOnClickListener(新视图.OnClickListener(){
@凌驾
公共void onClick(视图v){
/*意向i=新意向(活动\结果。这是活动\知识状态。类);
星触觉(i)*/
最终对话框=新对话框(活动\结果。此);
对话框.requestWindowFeature(窗口.FEATURE\u无\u标题);
setContentView(R.layout.custom_dialoghealthdata);
dialog.getWindow().setBackgroundDrawable(新的ColorDrawable(android.graphics.Color.TRANSPARENT));
ImageView dialogButtonCancel=(ImageView)dialog.findViewById(R.id.ImageView\u close);
按钮对话框ButtonOK=(按钮)dialog.findViewById(R.id.btn_ok);
//单击“取消”关闭android自定义对话框
dialogButtonCancel.setOnClickListener(新视图.OnClickListener(){
@凌驾
公共void onClick(视图v){
dialog.dismise();
}
});
//您的android自定义对话框确定操作
//自定义对话框的操作“确定”按钮单击
dialogButtonOk.setOnClickListener(新视图.OnClickListener(){
@凌驾
公共void onClick(视图v){
意向i=新意向(活动\结果。这是活动\知识状态。类);
星触觉(i);
}
});
dialog.show();
}
});
}
@凌驾
受保护的void onResume(){
super.onResume();
毕加索。用(这个)
.load(Config.API_URL+“/sites/default/files/”+uiidd+“.png”)
.进入(图像视图);
}
/*@覆盖
public void onBackPressed()
{
完成();
}*/
私有void resultjsonrequest(){
Util.showProDialog(Activity_result.this,“加载…”);
JsonObjectRequest JSONObjectReq=新的JsonObjectRequest(Request.Method.GET,
Config.API_URL+“/profile result json?userProfileID=“+uiidd+”,null,新响应。侦听器(){
@凌驾
公共void onResponse(JSONObject响应){
试一试{
String txt_totalscore1=response.getString(“患者_分数”);
txtvw_totalscore.setText(txt_totalscore 1);
String txt_chol1=response.getString(“胆固醇”);
txt_chol.setText(txt_chol1);
String cholcolor=response.getString(“胆固醇点颜色”);
线性回归背景色(Color.parseColor(cholcolor));
String txt_trigly1=response.getString(“甘油三酯”);
txt_trigly.setText(txt_trigly 1);
String triglycolor=response.getString(“triglycolor”);
线性的三次色(Color.parseColor(triglycolor));
String txt_hdlchol1=response.getString(“hdlcholestol%”);
txt_hdl_chol.setText(txt_hdlchol1);
String hdlchl1color=response.getString(“hDL_胆固醇_分数颜色”);
线性(hdl)背景色(Color.parseColor(hdlchl1color));
String txt_sysbp1=response.getString(“SystolicBP”);
txt_sysolicbp.setText(txt_sysbp1);
String systoiccolor=response.getString(“systolic\u bp\u scoreColor”);
线性系统背景色(Color.parseColor(systoiccolor));
字符串txt_disys1=
Picasso.with(this)
        .load(Config.API_URL+"/sites/default/files/"+uiidd+".png")
        .into(imageView);
    double token=0;
    token=Math.random();
    Picasso.with(getApplicationContext()).invalidate("");
    Picasso.with(this)
                 .load(Config.API_URL+"/sites/default/files/"+uiidd+".png?"+token)
            .memoryPolicy(MemoryPolicy.NO_CACHE)
            .networkPolicy(NetworkPolicy.NO_CACHE)
            .into(imageView_chartt);