当我输入字符串private fun getMoreBooks(lastBook: Timestamp) {
bookCollection
.orderByChild("created_at", Query.Direction.DESCENDING)
.equalTo(lastBook)
.limitToFirst(10).get()
.addOnSuccessListener {booksSnapshot ->
if (!booksSnapshot.isEmpty) {
for (bookSnapShot in booksSnapshot.documents) {
val hashmap = bookSnapShot.data
hashmap?.put("id", bookSnapShot.id)
val bookData = Gson().toJson(hashmap)
val book = Gson().fromJson<Book>(bookData, Book::class.java)
adapter.addDatainList(book)
}
}
}
}
作为我想要的数字的二进制形式时,我得到
代码中的错误溢出
。以十进制表示的1111101110001110
。我将其返回给main函数中的整数。这个数字应该足够小,以免整数溢出?任何帮助将不胜感激。
64398