fix: use UI context for more Toasts

Fixes: a3b88c1dee ("fix: use activity context for Toast")
This commit is contained in:
Harsh Shandilya 2023-03-08 22:59:12 +05:30
parent fe921a58b9
commit 16d6b1e853
No known key found for this signature in database
2 changed files with 3 additions and 3 deletions

View file

@ -192,7 +192,7 @@ abstract class GitOperation(protected val callingActivity: FragmentActivity) {
// users though, who might deduce that the screen lock
// protection is not effective. Hence, we fail with an error.
Toast.makeText(
callingActivity.applicationContext,
callingActivity,
R.string.biometric_auth_generic_failure,
Toast.LENGTH_LONG
)

View file

@ -88,7 +88,7 @@ internal val AssistStructure.ViewNode.webOrigin: String?
}
@RequiresApi(Build.VERSION_CODES.O)
public class FixedSaveCallback(context: Context, private val callback: SaveCallback) {
public class FixedSaveCallback(private val context: Context, private val callback: SaveCallback) {
private val applicationContext = context.applicationContext
@ -98,7 +98,7 @@ public class FixedSaveCallback(context: Context, private val callback: SaveCallb
// See
// https://developer.android.com/reference/android/service/autofill/SaveCallback#onFailure(java.lang.CharSequence)
if (applicationContext.applicationInfo.targetSdkVersion >= 29) {
Toast.makeText(applicationContext, message, Toast.LENGTH_LONG).show()
Toast.makeText(context, message, Toast.LENGTH_LONG).show()
}
}