|
|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package com.cyb3rko.techniklogger
|
|
|
|
|
|
|
|
|
|
import android.annotation.SuppressLint
|
|
|
|
|
import android.content.Intent
|
|
|
|
|
import android.content.SharedPreferences
|
|
|
|
|
import androidx.core.content.ContextCompat.startActivity
|
|
|
|
|
@ -31,6 +32,7 @@ internal const val NAME = "name"
|
|
|
|
|
internal const val TECHNIKER_ID = "technikerId"
|
|
|
|
|
internal const val SHARED_PREFERENCE = "Safe"
|
|
|
|
|
|
|
|
|
|
@SuppressLint("CheckResult")
|
|
|
|
|
internal fun showNameDialog(
|
|
|
|
|
activity: MainActivity,
|
|
|
|
|
sharedPref: SharedPreferences,
|
|
|
|
|
@ -51,7 +53,7 @@ internal fun showNameDialog(
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
positiveButton(0, "Speichern") {
|
|
|
|
|
sharedPrefEditor.putString("name", inputName.toString()).commit()
|
|
|
|
|
sharedPrefEditor.putString("name", inputName.toString().trim()).commit()
|
|
|
|
|
activity.finish()
|
|
|
|
|
startActivity(activity, Intent(activity, MainActivity::class.java), null)
|
|
|
|
|
}
|
|
|
|
|
|