我试图从存储在表中的 url 获取图像,但是当我尝试获取图像时,ImageView 不包含任何内容,它只是空白。
在我下面的代码中,我使用 Picasso 来获取图片:
public class Imageoffam extends AppCompatActivity {
private boolean success = false; // boolean
private ConnectionClass connectionClass;
public TextView tmtmt;
public ImageView dede;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_imageoffam);
getSupportActionBar().hide();
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
tmtmt = (TextView) findViewById(R.id.tomato) ;
dede = (ImageView) findViewById(R.id.dededede);
connectionClass = new ConnectionClass();
SyncData orderData = new SyncData();
orderData.execute("");
}
private class SyncData extends AsyncTask<String, String, String> {
String msg = "Success";
ProgressDialog progress;
@Override
protected void onPreExecute() {
progress = ProgressDialog.show(Imageoffam.this, "Synchronising",
"Please Wait...", true);
}
@Override
protected String doInBackground(String... strings) {
try {
Connection conn = connectionClass.CONN();
if (conn == null) {
msg = "Please Check Your Connection";
success = false;
} else {
String dta = getIntent().getStringExtra("blala");
String query = "SELECT Images.Fimage,family.FName,family.FInfo,family.CID FROM Images INNER JOIN family ON family.FID = Images.FID WHERE family.FInfo = (N'" +dta+ "')";
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery(query);
尽管它没有在 ImageView 中显示图像,但它没有给出任何错误消息。
有人可以告诉我我做错了什么吗?
任何帮助,将不胜感激。
慕尼黑5688855
哔哔one
万千封印
相关分类