SamuelP Member Licensed User Feb 20, 2018 #1 Hello, in my main-Activity I use this code: Code: Copy Sub listview1_ItemClick (Position As Int, Value As Object) CallSubDelayed2(Monatseingabe, "SetKlient", listview1.GetItem(Position)) End Sub This should (and does) show the "Monatseingabe"-Activity and fill it with data from the database. When I hit the back-button to return to the Main-Activity and to select another listview-Item, the Monatseingabe-Activity is completly loaded agin (needs long time because it contains a lot of labels). Is there a way to keep the Monatseingabe-Activity cached? So that I only have to change the content of the views without loading them again? Samuel
Hello, in my main-Activity I use this code: Code: Copy Sub listview1_ItemClick (Position As Int, Value As Object) CallSubDelayed2(Monatseingabe, "SetKlient", listview1.GetItem(Position)) End Sub This should (and does) show the "Monatseingabe"-Activity and fill it with data from the database. When I hit the back-button to return to the Main-Activity and to select another listview-Item, the Monatseingabe-Activity is completly loaded agin (needs long time because it contains a lot of labels). Is there a way to keep the Monatseingabe-Activity cached? So that I only have to change the content of the views without loading them again? Samuel
klaus Expert Licensed User Longtime User Feb 20, 2018 #2 You can use two panels in the Main activity and set the visible property to False and True. Upvote 0
SamuelP Member Licensed User Feb 20, 2018 #3 Do you mean I should use two panels instead of two activites? This would mean, I can use only one bal-File? Is there no other solution ? Upvote 0
Do you mean I should use two panels instead of two activites? This would mean, I can use only one bal-File? Is there no other solution ?
lemonisdead Well-Known Member Licensed User Longtime User Feb 20, 2018 #4 SamuelP said: Is there no other solution ? Click to expand... Yes they are options : not caching the Activity but the variables used to fill the views. Services (and especially the Starter service) are useful for that task. For example : the list that fills ListView1 could be created in a service and applied to ListView1 in Activity_Resume. Note: myself, I do often use a Process_Globals list variable associated to an Activity Globals list variable where I put the Activity's views to be able to manage them directly from inside the services. But that's a bit tricky, not clean at all and outside the range of that simple task (see previous paragraph) Upvote 0
SamuelP said: Is there no other solution ? Click to expand... Yes they are options : not caching the Activity but the variables used to fill the views. Services (and especially the Starter service) are useful for that task. For example : the list that fills ListView1 could be created in a service and applied to ListView1 in Activity_Resume. Note: myself, I do often use a Process_Globals list variable associated to an Activity Globals list variable where I put the Activity's views to be able to manage them directly from inside the services. But that's a bit tricky, not clean at all and outside the range of that simple task (see previous paragraph)
klaus Expert Licensed User Longtime User Feb 20, 2018 #5 Do you mean I should use two panels instead of two activites? Click to expand... Yes. This would mean, I can use only one bal-File? Click to expand... No ! You can use two layout files one for each Panel. Upvote 0
Do you mean I should use two panels instead of two activites? Click to expand... Yes. This would mean, I can use only one bal-File? Click to expand... No ! You can use two layout files one for each Panel.
MarkusR Well-Known Member Licensed User Longtime User Feb 20, 2018 #6 contains a lot of labels Click to expand... how much? Upvote 0