question

dhananjay avatar image
dhananjay asked dhananjay edited

Barcode broadcast receiver only working when the application is in RAM

I have implemented code for when broadcast for barcode is received it will create order but it only works when the application in RAM.

It only received a barcode only when App is in Ram

Below is my code for manifest-

<receiver
    android:name="com.apple.utility.BarcodeBroadcastReceiver"
    android:enabled="true"
    android:exported="false">
    <intent-filter>
        <action android:name="com.clover.BarcodeBroadcast" />
    </intent-filter>
</receiver>


my BroadcastReciever for barcode -

class BarcodeBroadcastReceiver : BroadcastReceiver() {

 override fun onReceive(context: Context?, intent: Intent?) {
     val barcodeResult = BarcodeResult(intent)
     Toast.makeText(context, "Here is your barcode data11 - ${barcodeResult.barcode}", Toast.LENGTH_SHORT).show()
 }
}


Thanks in advance,

clover developer communityBroadcasts
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community