I found couple of answers for this but I don't understand what the hell they are talking about and what to do in my case.
This is the code:
Functions().(prefs!!.getLong("userid", 0), prefs!!.getString("notifToken", "")!!)
I get Unexpected tokens (use ';' to separate expressions on the same line)
for prefs!!.getString("notifToken", "")!!
And in Functions class:
fun lastOnline(userid: Long, token: String){
val params = RequestParams()
params.put("userid", userid)
params.put("token", token)
val client = AsyncHttpClient()
client.post("https://www.bla.com/do.php", params, object : JsonHttpResponseHandler()
{
override fun onSuccess(statusCode: Int, headers: Array<Header>?, response: JSONArray?)
{
}
override fun onFailure(statusCode: Int, headers: Array<Header>?, e: Throwable, response: JSONArray?)
{
Log.d("pikabo", "error")
}
})
}
Please help!
Your code boils down to Functions().()
, and that does not make a lot of sense. Functions()
will create an instance of your Functions
class. But then you seem to be missing a function name after the .
.
I am going to guess that you are trying to call lastOnline()
, in which case you need to use that function name:
Functions().lastOnline(prefs!!.getLong("userid", 0), prefs!!.getString("notifToken", "")!!)
如果一切看起来都不错,但仍然出现相同的错误,请检查键入/粘贴的代码行中是否有任何隐藏字符
Just remove the excess !!
because it will never be null
with a default value passed into.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.