Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion app/src/main/java/com/barebone/app/ForgotPassword.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@ class ForgotPassword : AppCompatActivity() {
resources.getString(R.string.defaultValue)
)
val forgotPasPhrase: TextView = findViewById(R.id.enterMobileNumber)
// Use takeLast instead of a fixed subSequence(6, 10) range: stored mobile numbers
// shorter than 10 characters (e.g. bad data, or the "null" default fallback) would
// otherwise throw StringIndexOutOfBoundsException as soon as this screen opens.
val sourceString = "Enter your mobile number ending with " + "<b>" + "******${
actualMobileNumber.toString().subSequence(6, 10)
actualMobileNumber.orEmpty().takeLast(4)
}" + "</b>"
forgotPasPhrase.text = Html.fromHtml(sourceString)

Expand Down