Ensure api version has been fetched before checking.
This commit is contained in:
parent
9b372a45ce
commit
1f20e19a97
@ -197,10 +197,6 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
|
|||||||
|
|
||||||
getApiMajorVersion()
|
getApiMajorVersion()
|
||||||
|
|
||||||
if (apiVersionMajor > 2) {
|
|
||||||
dateTimeFormatter = "yyyy-MM-dd'T'HH:mm:ssXXX"
|
|
||||||
}
|
|
||||||
|
|
||||||
getElementsAccordingToTab()
|
getElementsAccordingToTab()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -426,6 +422,10 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
|
|||||||
override fun onResponse(call: Call<ApiVersion>, response: Response<ApiVersion>) {
|
override fun onResponse(call: Call<ApiVersion>, response: Response<ApiVersion>) {
|
||||||
val version = response.body() as ApiVersion
|
val version = response.body() as ApiVersion
|
||||||
apiVersionMajor = version.getApiMajorVersion()
|
apiVersionMajor = version.getApiMajorVersion()
|
||||||
|
|
||||||
|
if (apiVersionMajor > 2) {
|
||||||
|
dateTimeFormatter = "yyyy-MM-dd'T'HH:mm:ssXXX"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user