คำถามติดแท็ก typetoken

7
วิธีใช้ TypeToken + generics กับ Gson ใน Kotlin
ฉันไม่สามารถรับรายการประเภททั่วไปจากคลาสที่กำหนดเองได้ (เทิร์น): val turnsType = TypeToken<List<Turns>>() {}.type val turns = Gson().fromJson(pref.turns, turnsType) มันกล่าวว่า: cannot access '<init>' it is 'public /*package*/' in 'TypeToken'
โดยการใช้ไซต์ของเรา หมายความว่าคุณได้อ่านและทำความเข้าใจนโยบายคุกกี้และนโยบายความเป็นส่วนตัวของเราแล้ว
Licensed under cc by-sa 3.0 with attribution required.