R rls456 Member Licensed User Longtime User Feb 8, 2011 #1 How do I access Listview in a different module. thanks
Erel B4X founder Staff member Licensed User Longtime User Feb 8, 2011 #2 You cannot access a ListView that belongs to a different activity. While one activity is visible the other can be destroyed. You should store the data in a List as a process global object. Upvote 0
You cannot access a ListView that belongs to a different activity. While one activity is visible the other can be destroyed. You should store the data in a List as a process global object.
R rls456 Member Licensed User Longtime User Feb 8, 2011 #3 Access list in another activity Erel said: You cannot access a ListView that belongs to a different activity. While one activity is visible the other can be destroyed. You should store the data in a List as a process global object. Click to expand... I had allready tried that but can not access the list in a different activity. when i test the application i get an error that i need to initlize the list first. I initilized the list in on create and still get the message. I use Main.List = dosomething Upvote 0
Access list in another activity Erel said: You cannot access a ListView that belongs to a different activity. While one activity is visible the other can be destroyed. You should store the data in a List as a process global object. Click to expand... I had allready tried that but can not access the list in a different activity. when i test the application i get an error that i need to initlize the list first. I initilized the list in on create and still get the message. I use Main.List = dosomething
Erel B4X founder Staff member Licensed User Longtime User Feb 8, 2011 #4 There should be no problem accessing a List declared as a process global object in one module from another. Please post your code if it doesn't work for you. Upvote 0
There should be no problem accessing a List declared as a process global object in one module from another. Please post your code if it doesn't work for you.
R rls456 Member Licensed User Longtime User Feb 8, 2011 #5 Erel said: There should be no problem accessing a List declared as a process global object in one module from another. Please post your code if it doesn't work for you. Click to expand... 'Activity1 module Sub Process_Globals 'These global variables will be declared once when the application starts. 'These variables can be accessed from all modules. Dim VoiceNo As Int Dim MyResult As String Dim ListItems As List End Sub Activity2 Sub Globals 'These global variables will be redeclared each time the activity is created. 'These variables can only be accessed from this module. Dim EditText1 As EditText Dim EditText2 As EditText Dim label1 As Label Dim label2 As Label Dim EmailList As List End Sub " on button click" Dim txt, item As String Dim i As Int txt = "" For i =0 To EmailList.Size -1 item = EmailList.Get(i) txt=txt&item&CRLF Next Label1.Text = txt Upvote 0
Erel said: There should be no problem accessing a List declared as a process global object in one module from another. Please post your code if it doesn't work for you. Click to expand... 'Activity1 module Sub Process_Globals 'These global variables will be declared once when the application starts. 'These variables can be accessed from all modules. Dim VoiceNo As Int Dim MyResult As String Dim ListItems As List End Sub Activity2 Sub Globals 'These global variables will be redeclared each time the activity is created. 'These variables can only be accessed from this module. Dim EditText1 As EditText Dim EditText2 As EditText Dim label1 As Label Dim label2 As Label Dim EmailList As List End Sub " on button click" Dim txt, item As String Dim i As Int txt = "" For i =0 To EmailList.Size -1 item = EmailList.Get(i) txt=txt&item&CRLF Next Label1.Text = txt
Erel B4X founder Staff member Licensed User Longtime User Feb 8, 2011 #6 I don't see any call to a list in other activity. What am I missing??? Upvote 0