Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Интервал уведомлений (минуты):"
- android:layout_marginTop="16dp"/>
- <EditText
- android:id="@+id/editNotificationInterval"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:inputType="number"
- android:hint="Например, 60"/>
- val editNotificationInterval = findViewById<EditText>(R.id.editNotificationInterval)
- // Загружаем сохранённый интервал
- editNotificationInterval.setText(sharedPreferences.getInt("notificationInterval", 60).toString())
- val notificationInterval = editNotificationInterval.text.toString().toIntOrNull() ?: 60
- sharedPreferences.edit()
- .putInt("notificationInterval", notificationInterval)
- .apply()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement