Skip to content

Commit

Permalink
🐛 fix(DecryptionActivity.kt): fix condition to copy text
Browse files Browse the repository at this point in the history
The condition to copy text was checking if the length of the text was not equal to zero, which could lead to copying an empty string. The condition has been updated to check if the length of the text is greater than zero.
  • Loading branch information
rupeshshandilya committed Apr 6, 2023
1 parent ae1907c commit 9297807
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ class DecryptionActivity : AppCompatActivity() {
val dialog:Dialog = builder!!.create()

decodeText!!.setOnClickListener {
//To Copy Text if Text is present
if(decodeText!!.text.toString().length != 0) {
//To Copy Text if Text is present
if(decodeText!!.text.toString().length > 0) {
val clipManager = getSystemService(CLIPBOARD_SERVICE) as ClipboardManager
val clipData = ClipData.newPlainText("text", decodeText!!.text.toString())
clipManager.setPrimaryClip(clipData)
Expand Down

0 comments on commit 9297807

Please sign in to comment.