mirror of
https://github.com/Matte23/circolapp.git
synced 2026-10-15 23:45:16 +00:00
Fix crash when extracting id
This commit is contained in:
1 parent
3f2c5ab39f
commit
9154d81b39
1 file changed
+4
-1
@@ -38,7 +38,10 @@ data class Circular(
|
||||
) : Parcelable {
|
||||
companion object {
|
||||
fun generateFromString(string: String, url: String): Circular {
|
||||
val id = string.split(" ")[1]
|
||||
val idRegex = """(\d+)"""
|
||||
val matcherId = Pattern.compile(idRegex).matcher(string)
|
||||
matcherId.find()
|
||||
val id = matcherId.group(1)
|
||||
|
||||
val dateRegex = """(\d{2}/\d{2}/\d{4})"""
|
||||
val matcherDate = Pattern.compile(dateRegex).matcher(string)
|
||||
|
||||
Reference in new issue
Block a user