Android Question 3 lists - syncronise?

aidymp

Well-Known Member
Licensed User
Longtime User
Hi I have 3 lists, so far so good, someone said can I add a sort feature to my app.

And this is where the app falls to bits lol!

Its become apparent you cant sort 3 lists! So I thought of maps (as thats where my B4X experience stops)

So map1, map2, map3, and use the same key. then I can just sort the list and use the maps to get the data.

The Question is that the best way??

I have seen a custom type, and I made it, but cant work out how to add data to it, I was expecting to be able to do something like.

B4X:
Sub Process_Globals
    
Type InternalApps(App_Name As String, App_Package_name As String, App_Version As String, App_Icon As String)

End Sub

Sub Globals

Private var1 as string = "blah"
Private var2 as string = "blah 1"
Private var3 as string = "blah 2"
private var4 as String = "blah 3"

End Sub

Sub Activity_Create(FirstTime As Boolean)
InternalApps.initialise

' THE CONFUSION!'
InternalApps.Add(var1,var2,var3,var4)

End Sub

Where am I going wrong?

Thanks
 

DonManfred

Expert
Licensed User
Longtime User
Where am I going wrong?
Not using the CreateSUB feature.

Hover the mouse over the Type... Let b4a create a sub for you. Use this sub to create one type.

types024.png
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Im not getting that?
hmmm, weird.

this is the sub i could creat using this in B4A

B4X:
Public Sub CreateInternalApps (App_Name As String, App_Package_name As String, App_Version As String, App_Icon As String) As InternalApps
    Dim t1 As InternalApps
    t1.Initialize
    t1.App_Name = App_Name
    t1.App_Package_name = App_Package_name
    t1.App_Version = App_Version
    t1.App_Icon = App_Icon
    Return t1
End Sub
 
Upvote 0

aidymp

Well-Known Member
Licensed User
Longtime User
hmmm, weird.

this is the sub i could creat using this in B4A

B4X:
Public Sub CreateInternalApps (App_Name As String, App_Package_name As String, App_Version As String, App_Icon As String) As InternalApps
    Dim t1 As InternalApps
    t1.Initialize
    t1.App_Name = App_Name
    t1.App_Package_name = App_Package_name
    t1.App_Version = App_Version
    t1.App_Icon = App_Icon
    Return t1
End Sub

I have just downloaded and installed B4A again, loaded my project and tried moving the

B4X:
Type InternalApps (App_Name As String, App_Package_name As String, App_Version As String, App_Icon As String)

from Process_globals, to Globals, and again to Activity_Create to see if i could get the popup but no! hovering does nothing!

I will investigate.
 
Upvote 0
Top