Created
October 10, 2021 13:46
-
-
Save DanishAmjad12/b526028b390b05c4ba2f3d9b442f1e00 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun recognize(context: Context) { | |
val ink = inkBuilder.build() | |
recognizer.recognize(ink) | |
.addOnSuccessListener { result: RecognitionResult -> | |
Toast.makeText(context, "This is ${result.candidates[0].text}", Toast.LENGTH_LONG) | |
.show() | |
} | |
.addOnFailureListener { e: Exception -> | |
Toast.makeText(context, "Error", Toast.LENGTH_LONG) | |
.show() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment