データベースからimagepath
に付属のAPIです。データベースから取得したSharedPreferencesのイメージリストをHTML形式で保存する
APIInterface api = APiClient.getApiService();
Call<AdMain> call = api.getAd(lid);
call.enqueue(new Callback<AdMain>() {
@Override
public void onResponse(Call<AdMain> call, Response<AdMain> response) {
if (response.isSuccessful()) {
if (response.body().getData().size() == 0) {
LinearLayout.LayoutParams param = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 0, 3.78f);
expandid.setLayoutParams(param);
} else if (response.body().getData().size() == 1) {
Picasso.with(ShowNotesActivity.this).load("http://124.41.193.135:88/" + response.body().getData().get(0).getImagePath()).into(imgad);
} else {
imagepath = new ArrayList<>();
imageadlist = new ArrayList<>();
for (int i = 0; i < response.body().getData().size(); i++) {
imageadlist.add(response.body().getData().get(i).getImagePath());
endIndex = i;
}
Log.d("size", "onResponse: "+imagepath.size());
nextimage();
}
}
}
@Override
public void onFailure(Call<AdMain> call, Throwable t) {
}
});
ここで、私のSharedPreferencesのデータベースから来るこれらの画像をHTML形式で保存します。
イメージ?どのように説明pls。 – ADM
HTML形式ではないので、image /1.jpegのパスになります。ベースURL +画像パスを使用すると、画像が表示され、共有画像を保存する必要があります。インターネットが利用可能な場合は、画像を表示できます。 – sanjay