Android Question InputList disappears

positrom2

Active Member
Licensed User
An app working correctly on an older 7" tablet (Android 3.2.1) does not work on a Galaxy SII with Android 4.1.2 and smaller screen size. On the tablet the paired devices can be selected as usual from the popup-screen showing the paired devices, using inputlist (the code below was taken from the BluetoothAdmin tutorial).
B4X:
Sub Verbinden
    Dim PairedDevices As Map
    PairedDevices = blauerZahnDaten.GetPairedDevices
    Dim GeraeteListe As List
    GeraeteListe.Initialize
    For i = 0 To PairedDevices.Size - 1
        GeraeteListe.Add(PairedDevices.GetKeyAt(i))
    Next
    Dim res As Int
    res = InputList(GeraeteListe, "Bitte Gerät wählen", 2) 'show list with paired devices
    If res <> DialogResponse.CANCEL Then
        blauerZahnDaten.Connect(PairedDevices.Get(GeraeteListe.Get(res))) 'convert the name to mac address
    End If
End Sub
On the Galaxy SII the popupscreen shows up only very shortly and disappears without offering the possibility to select an item.
The nucleus of the problem might not be in the different Android versions nor screen sizes since I have another application using the same bluetooth setup which is working correctly on the Galaxy.
So my question is: In order to see the popup menu generated by Inputlist, are there any precautions to be taken considerering the screen layout? If other view are covering the screen, how to get the Input-list screen to the foreground?
 

ValDog

Active Member
Licensed User
Hope this is adequate. Seems like the culprit is the call to "StartService(LocationTracker)." When I comment it out the InputList call works just fine. Hope you can figure out how to get around it...
 

Attachments

  • GSight.zip
    60.4 KB · Views: 88
Upvote 0

ValDog

Active Member
Licensed User
Erel, thanks!

Not sure of the correct way to use this call in the same module, but "CallSubDelayed(Null,"btnConnect_Click")" seems to work...
 
Upvote 0
Top