release 0.1 #30
@ -3,6 +3,7 @@ package it.unisannio.ding.ids.wedroid.app.view
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.webkit.URLUtil
|
||||
import android.widget.Toast
|
||||
import it.unisannio.ding.ids.wedroid.app.R
|
||||
import it.unisannio.ding.ids.wedroid.app.util.SharedPreferenceHelper
|
||||
@ -39,10 +40,17 @@ class LoginActivity : AppCompatActivity() {
|
||||
|
||||
val userNameText = username.text.toString()
|
||||
val passwordText = password.text.toString()
|
||||
val instanceServerText = instanceServer.text.toString()
|
||||
|
||||
if (!URLUtil.isValidUrl(instanceServerText)){
|
||||
Toast.makeText(this, "Formato URL non valido", Toast.LENGTH_LONG)
|
||||
.show()
|
||||
return
|
||||
}
|
||||
|
||||
val service = Retrofit.Builder()
|
||||
.addConverterFactory(GsonConverterFactory.create())
|
||||
.baseUrl(instanceServer.text.toString())
|
||||
.baseUrl(instanceServerText)
|
||||
.build()
|
||||
.create(LoginService::class.java)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user