beachdogvet
Newbie
I developed an Android application that scans barcodes using Intents for a Motorola TC70 Touch Computer. The application works and all in that I can scan barcodes and put the scanned data (barcode) to a ListView.
The problem I'm having is that when I trigger a scan using the device's button, the first element in the activity_main gets selected. So for example, I have Menu options. When I push the scan button on the scanner, the options menu becomes selected and the first menu option is displayed.
If I put a Button above the ListView and scan something, then the Button (that's above the Listview) is then selected. I've tried setting focus to the ListView but that didn't work, or I implemented it wrong.
When I remove the Menu Options and button, and have nothing but the ListView in the View, it all works like I would expect it to. It's just when I start putting other controls onto the View that it starts acting goofy by the control becoming selected.
The problem I'm having is that when I trigger a scan using the device's button, the first element in the activity_main gets selected. So for example, I have Menu options. When I push the scan button on the scanner, the options menu becomes selected and the first menu option is displayed.
If I put a Button above the ListView and scan something, then the Button (that's above the Listview) is then selected. I've tried setting focus to the ListView but that didn't work, or I implemented it wrong.
When I remove the Menu Options and button, and have nothing but the ListView in the View, it all works like I would expect it to. It's just when I start putting other controls onto the View that it starts acting goofy by the control becoming selected.