-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUntitled
More file actions
21 lines (20 loc) · 1.28 KB
/
Untitled
File metadata and controls
21 lines (20 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
boolean checkImageStatus = singleTrackJSON.getJSONArray("image").getJSONObject(3).has("#text");
String checkImage = String.valueOf(checkImageStatus);
Log.d("ImageAva",checkImage);
if(checkImage.equals("true")){
String image = singleTrackJSON.getJSONArray("image").getJSONObject(3).getString("#text");
Track track = new Track(name, artist, website, listeners, image);
tracks.add(track);
}else{
String image = "https://lastfm-img2.akamaized.net/i/u/174s/c6f59c1e5e7240a4c0d427abd71f3dbb.png";
Track track = new Track(name, artist, website, listeners, image);
tracks.add(track);
}
for(int x = 0; x < imageJSON.length(); x++) {
if(imageJSON.getJSONObject(x).toString()){
images.add("https://lastfm-img2.akamaized.net/i/u/174s/c6f59c1e5e7240a4c0d427abd71f3dbb.png");
}else{
images.add(imageJSON.getJSONObject(x).getString("#text"));
}
}
Log.d("ArrayList",images.toString());