Created
May 5, 2020 20:02
-
-
Save ozcankrks/aafc36c896083d9e8e289295e0b03df7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| try | |
| { | |
| // + Json verisi çekiliyor. | |
| jsonData = GetJsonData(url); | |
| // - | |
| // + Gelen veri liste şeklinde olacağı için | |
| // Modelimizin Liste tipinde olacağını belirtiyoruz. | |
| Type postModelListType = new TypeToken<List<CardModal>>(){}.getType(); | |
| // - | |
| // + Gson ile Json verisi okunur ve Listeye alınır. | |
| Gson gson = new Gson(); | |
| postsModelList = gson.fromJson(jsonData, postModelListType); | |
| for (CardModal pa : postsModelList) { | |
| if (pa.getRegionRef().equals("Noxus")){ | |
| noxusList.add(pa); | |
| }else if (pa.getRegionRef().equals("Ionia")){ | |
| IoniaList.add(pa); | |
| }else if (pa.getRegionRef().equals("Freljord")){ | |
| freljordList.add(pa); | |
| } | |
| else if (pa.getRegionRef().equals("Demacia")){ | |
| demaciaList.add(pa); | |
| }else if (pa.getRegionRef().equals("ShadowIsles")){ | |
| shadow.add(pa); | |
| }else if (pa.getRegionRef().equals("PiltoverZaun")){ | |
| ZaunPiltoverList.add(pa); | |
| } | |
| } | |
| for (CardModal pa : noxusList) { | |
| Log.d("noxus",pa.getName()); | |
| } | |
| // - | |
| Log.d("sd",postsModelList.get(32).getName()); | |
| Log.d("sd",postsModelList.get(32).getAssets().get(0).getGameAbsolutePath()); | |
| } | |
| catch (IOException e) | |
| { | |
| e.printStackTrace(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment