Name | Description |
|---|---|
Action | com.zebra.dfs.SELECTED_ROLE_STATUS |
Extra 0 | |
Type | String |
Name | user_info
|
Value | Currently, logged in user information. |
Extra 1 | |
Type | String |
Name | role
|
Value | Currently selected user role Information. |
Extra 2 | |
Type | String |
Name | customer_id
|
Value | Currently, logged in customer information. |
Extra 3 | |
Type | String |
Name | site_id
|
Value | Currently selected site information. |
Extra 4 | |
Type | String |
Name | status_code
|
Value | Provides error code details. |
Extra 5 | |
Type | String |
Name | status_message
|
Value | Provides details on the issue; it should be one of the following:
|
Extra 6 | |
Type | String |
Name | timestamp
|
Value | Current timestamp of the occurrence. |
class MainActivity : AppCompatActivity() {
lateinit var tvMessage:TextView;
val receiver:BroadcastReceiver = object : BroadcastReceiver() {
override fun onReceive(context: Context?, intent: Intent?) {
Log.d("DFSIntentReceiver", "Received intent: ${intent?.action}")
var text = "Received Intent"
intent?.extras?.keySet()?.forEach {
val msg= "${it}: ${intent?.extras?.get(it)}"
Log.d("DFSIntentReceiver", "${it}: ${intent?.extras?.get(it)}")
text = text+"\n\n"+msg
}
tvMessage.setText(text)
}
};
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
tvMessage = findViewById<TextView>(R.id.tvMessage)
val filter = IntentFilter("com.zebra.dfs.SELECTED_ROLE_STATUS")
registerReceiver(receiver, filter, RECEIVER_EXPORTED)
}