title: How to display Toast.makeText result in another page textView using kotlin
body: <p>//This is my scanner barcode code using kotlin</p>
  <p>override fun receiveDetections(detections: Detector.Detections) {</p>
  <pre><code>            val barcodes = detections.detectedItems
              if (barcodes.size() == 1) {
                  scannedValue = barcodes.valueAt(0).rawValue
                  runOnUiThread {
                      cameraSource.stop()
                      Toast.makeText(this@InsertStockInActivity, &quot;value- $scannedValue&quot;, Toast.LENGTH_SHORT).show()
                      finish()
                  }
              }else
              {
                  Toast.makeText(this@InsertStockInActivity, &quot;value- else&quot;, Toast.LENGTH_SHORT).show()
  
              }
          }
  </code></pre>
  <p>//This is my input page</p>
  <p>override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {</p>
  <pre><code>    binding = FragmentInputStockInBinding.inflate(inflater, container, false)
      binding.btnScanBarcode.setOnClickListener{ nav.navigate(R.id.insertStockInActivity)}
  
      return binding.root
  }[enter image description here][1]
  </code></pre>