Created
January 4, 2024 06:30
-
-
Save chiragthummar/d413dd66dc10fb4d21acc637c0e9dff6 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
import android.content.Context | |
import android.webkit.JavascriptInterface | |
import android.widget.Toast | |
class JavaScriptInterface { | |
private val context : Context | |
constructor(context : Context){ | |
this.context = context | |
} | |
@JavascriptInterface | |
fun showToast(str : String){ | |
Toast.makeText(context, "Message Received From Java Script $str", Toast.LENGTH_SHORT).show() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment