Problem with Layout?

trebun

Member
Licensed User
Longtime User
Hi there,

maybe I have some troubles with the layout - but I don't know, to fix it.

B4X:
   Activity.LoadLayout("Main")

   Activity.AddMenuItem("Einträge anzeigen...","mnuAnzeigen")
   Activity.AddMenuItem("Einträge als CSV versenden...","mnuCSV")
   Activity.AddMenuItem("Tabelle löschen!","mnuDeleteTable")
   Activity.AddMenuItem("Programm beenden.","mnuExit")

I test the app on two Devices - Samsung Galaxy Nexus and HTC Desire HD.

But, only on the Galaxy Nexus will show a menu - on the Desire I have no chance to open it. I push "Menu" on the hardware-buttons on the device, but it does nothing.

Galaxy Nexus use 4.2 (stock), DHD use a custom rom with 4.0.4.

Whats wrong? I will only create apps for ics...

My Manifest looks like:
B4X:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: http://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="14"/>
<supports-screens android:largeScreens="true" 
    android:normalScreens="true" 
    android:smallScreens="true" 
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
SetApplicationAttribute(android:theme, @android:style/Theme.Holo.Light)
'End of default text.

Regards,
trebun
 

Attachments

  • gn.jpg
    gn.jpg
    49.2 KB · Views: 195
  • dhd.jpg
    dhd.jpg
    42.9 KB · Views: 184

trebun

Member
Licensed User
Longtime User
Just to test, set the target sdk to 10 in your manifest. Your menu will then work. To keep the correct theme, set it back to sdk 14 after you test and add a button that calls activity.openmenu.

Hey Margret,

thank you for your quick answer! :)

I add this:

B4X:
Sub Activity_KeyPress (KeyCode As Int) As Boolean
If KeyCode = KeyCodes.KEYCODE_MENU Then
   Activity.OpenMenu
End If

Return True
End Sub

Thank you! :)

Regards,
trebun
 
Last edited:
Upvote 0
Top