-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug fix again
- Loading branch information
Showing
6 changed files
with
51 additions
and
16 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
package com.gcorp.retrofithelperexample | ||
open class T3 { | ||
var id: String = "pashm" | ||
var name: String = "pashm" | ||
var isComplete: Boolean = false | ||
val items: List<Item>? = null | ||
|
||
|
||
inner class Item{ | ||
var name: String = "" | ||
var url: String = "" | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
app/src/main/java/com/gcorp/retrofithelperexample/Test.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.gcorp.retrofithelperexample; | ||
|
||
import android.util.JsonReader; | ||
import com.google.gson.Gson; | ||
|
||
import java.io.StringReader; | ||
|
||
public class Test { | ||
|
||
void aa(){ | ||
String json= "{items=[{name=Fruit Ninja Fight, url=https://www.farsroid.com/wp-content/uploads/Fruit-Ninja-Fight-Logo-150x150.png}, {name=Trailer Park Boys, url=https://www.farsroid.com/wp-content/uploads/Trailer-Park-Boys-Greasy-Money-logo-c-150x150.png}, {name=Cradle of Empires, url=https://www.farsroid.com/wp-content/uploads/Cradle-of-Empires-logo-d-150x150.png}, {name=Disco Ducks, url=https://www.farsroid.com/wp-content/uploads/Disco-Ducks-150x150.png}, {name=Manor Cafe, url=https://www.farsroid.com/wp-content/uploads/Manor-Cafe-logo-f-150x150.png}, {name=Live or Die: Survival, url=https://www.farsroid.com/wp-content/uploads/Live-or-Die-survival-2019-logo-150x150.jpg}]}"; | ||
Gson gson = new Gson(); | ||
JsonReader reader = new JsonReader(new StringReader(json)); | ||
reader.setLenient(true); | ||
T3 userinfo1 = (T3) gson.fromJson(String.valueOf(reader), T3.class); | ||
} | ||
} |
4 changes: 3 additions & 1 deletion
4
retrofithelper/src/main/java/com/gcorp/retrofithelper/Response.kt
This file contains 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
This file contains 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