mirror of
https://github.com/janishutz/libreevent.git
synced 2025-11-25 05:14:23 +00:00
fix bug in seat selector + more android stuff
This commit is contained in:
@@ -18,7 +18,7 @@ class MainActivity : AppCompatActivity() {
|
||||
val policy = ThreadPolicy.Builder().permitAll().build()
|
||||
StrictMode.setThreadPolicy(policy)
|
||||
|
||||
val sharedPref = getPreferences( MODE_PRIVATE )
|
||||
val sharedPref = getSharedPreferences( "login", MODE_PRIVATE )
|
||||
|
||||
val hasSwitched = intent.hasExtra("hasSwitched")
|
||||
|
||||
@@ -50,7 +50,7 @@ class MainActivity : AppCompatActivity() {
|
||||
val res = ApiClient().authenticateUser( url, username, password )
|
||||
println( res )
|
||||
if ( res == "authOk" ) {
|
||||
val sharedPref = getPreferences( MODE_PRIVATE )
|
||||
val sharedPref = getSharedPreferences( "login", MODE_PRIVATE )
|
||||
val editor = sharedPref.edit()
|
||||
editor.putString( "username", username )
|
||||
editor.putString( "password", password )
|
||||
|
||||
@@ -4,7 +4,6 @@ import android.Manifest
|
||||
import android.app.AlertDialog
|
||||
import android.content.Intent
|
||||
import android.content.pm.PackageManager
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import android.os.Bundle
|
||||
import android.widget.Button
|
||||
import androidx.core.app.ActivityCompat
|
||||
@@ -28,7 +27,7 @@ class ScannerActivity : CaptureActivity() {
|
||||
|
||||
val logoutButton = findViewById<Button>(R.id.logoutButton)
|
||||
logoutButton.setOnClickListener {
|
||||
val sharedPref = getPreferences( MODE_PRIVATE )
|
||||
val sharedPref = getSharedPreferences( "login", MODE_PRIVATE )
|
||||
val editor = sharedPref.edit()
|
||||
editor.remove( "loginOk" )
|
||||
editor.remove( "username" )
|
||||
@@ -64,8 +63,7 @@ class ScannerActivity : CaptureActivity() {
|
||||
|
||||
private fun handleScanResult(result: String) {
|
||||
if ( lastScanned != result ) {
|
||||
println(result)
|
||||
val sharedPref = getPreferences( MODE_PRIVATE )
|
||||
val sharedPref = getSharedPreferences( "login", MODE_PRIVATE )
|
||||
|
||||
ApiClient().checkTicket( sharedPref.getString( "url", null ).toString(),
|
||||
sharedPref.getString( "username", null ).toString(),
|
||||
|
||||
Reference in New Issue
Block a user