2

Activity A wants to update a listView inside the same activity. Value is received from a surfaceview - scan, it should not update the listView until the finish button is pressed.

notbad
  • 2,797
  • 3
  • 23
  • 34
  • why here you want to 'call' same activity? you need to update the listview while you are in the same activity ? – Jacks Nov 27 '19 at 17:35
  • In Activity A there is a surfaceview which has camera opened for scanning qrcodes. I need to scan qrcode continuously and store the result each time into the list until finish button pressed. – Nimisha Revi Nov 27 '19 at 17:39
  • ok, you need to use a callback on scancomplete each time and you have to use a thread to update the listview - notifydatasetchange. – Jacks Nov 27 '19 at 17:54
  • Getting an error like... Exception thrown from receiver. java.lang.illegalstateexception:Detection processor must first be set with setprocessor in order to get Detection results. – Nimisha Revi Nov 28 '19 at 04:07
  • can you add code and logs here to understand more – Jacks Nov 28 '19 at 15:50

1 Answers1

0

you can use fragments in your activity and then use fragment manager to navigate between your camera page and the listView page.

you can use bundles to share data between these two fragments.

use this to learn more about fragments: https://developer.android.com/guide/components/fragments
and for sharing data between fragments visit this: How to pass variables with Android fragmentmanager

malekiamir
  • 119
  • 2
  • 11