diff --git a/app/src/main/java/com/example/nemophila/RequestedActivity.java b/app/src/main/java/com/example/nemophila/RequestedActivity.java index 1ef29da..582da5b 100644 --- a/app/src/main/java/com/example/nemophila/RequestedActivity.java +++ b/app/src/main/java/com/example/nemophila/RequestedActivity.java @@ -23,7 +23,6 @@ import android.widget.TextView; import android.widget.Toast; -import com.example.nemophila.entities.Account; import com.example.nemophila.entities.AccountNameJson; import com.example.nemophila.viewmodels.FriendViewModel; @@ -40,7 +39,7 @@ private final ExecutorService executor = Executors.newSingleThreadExecutor(); private final Handler handler = new Handler(); - private String IconUrlString; + private String iconUrlString; @Override protected void onCreate(Bundle savedInstanceState) { @@ -120,10 +119,11 @@ data.setName(acj.getName()); requestedDataSet.add(data); - IconUrlString = "http://nitta-lab-www.is.konan-u.ac.jp/nemophila-data/test01.jpg"; + iconUrlString = "http://nitta-lab-www.is.konan-u.ac.jp/nemophila-data/icon" + data.getId() + ".jpg"; + data.setUrl(iconUrlString); executor.execute(() -> { try { - URL url = new URL(IconUrlString); + URL url = new URL(data.getUrl()); HttpURLConnection con = (HttpURLConnection) url.openConnection(); con.connect(); @@ -221,6 +221,7 @@ private String name; private String id; private Bitmap icon; + private String url; public String getName() { return name; @@ -231,6 +232,9 @@ public Bitmap getIcon() { return icon; } + public String getUrl() { + return url; + } public void setName(String name) { this.name = name; @@ -239,5 +243,8 @@ public void setIcon(Bitmap icon) { this.icon = icon; } + public void setUrl(String url) { + this.url = url; + } } } \ No newline at end of file