omidaghakhani1368 Well-Known Member Licensed User Longtime User Oct 12, 2014 #1 Hi to all. I Fill scrollview panel with item but when every time device rotated,scrollview reload how prevent this action?
Hi to all. I Fill scrollview panel with item but when every time device rotated,scrollview reload how prevent this action?
LucaMs Expert Licensed User Longtime User Oct 12, 2014 #2 Do you mean that you lose your data or you lose the views contained in the ScrollView? In the first case, you should use KeyValueStore. In the second case, you should fill the Scrollview in the Activity_Create. Upvote 0
Do you mean that you lose your data or you lose the views contained in the ScrollView? In the first case, you should use KeyValueStore. In the second case, you should fill the Scrollview in the Activity_Create.
omidaghakhani1368 Well-Known Member Licensed User Longtime User Oct 12, 2014 #3 LucaMs said: Do you mean that you lose your data or you lose the views contained in the ScrollView? In the first case, you should use KeyValueStore. In the second case, you should fill the Scrollview in the Activity_Create. Click to expand... Oh yes,your reply is right but if i fill the scrollview in Activity_Create,in rotation device reloaded,is not? Upvote 0
LucaMs said: Do you mean that you lose your data or you lose the views contained in the ScrollView? In the first case, you should use KeyValueStore. In the second case, you should fill the Scrollview in the Activity_Create. Click to expand... Oh yes,your reply is right but if i fill the scrollview in Activity_Create,in rotation device reloaded,is not?
Erel B4X founder Staff member Licensed User Longtime User Oct 13, 2014 #4 That is correct. The activity is recreated when the orientation changes. However if you are loading any large objects such as bitmaps then you can store them in memory and reuse them. Upvote 0
That is correct. The activity is recreated when the orientation changes. However if you are loading any large objects such as bitmaps then you can store them in memory and reuse them.
omidaghakhani1368 Well-Known Member Licensed User Longtime User Oct 13, 2014 #5 But Erel look at below code : Code: Activity_Create(FirstTime as Boolean) dim top as int for i = 0 to 10 dim k as button k.initialize("") scrollview1.Panel.addview(k,0,top,150dip,50dip) top = top + 51dip next End sub now if activity create reload then scrollview load buttons,isn't? Upvote 0
But Erel look at below code : Code: Activity_Create(FirstTime as Boolean) dim top as int for i = 0 to 10 dim k as button k.initialize("") scrollview1.Panel.addview(k,0,top,150dip,50dip) top = top + 51dip next End sub now if activity create reload then scrollview load buttons,isn't?
Erel B4X founder Staff member Licensed User Longtime User Oct 13, 2014 #6 Yes. You need to recreate these buttons. However creating 10 buttons is a very quick operation. Upvote 0
omidaghakhani1368 Well-Known Member Licensed User Longtime User Oct 13, 2014 #7 ok ok but my item (button and imageview) is over 50 count my project is shop i load product list from database that is over 50 item and add it into scrollview panel now if activity rotated,then again load product from database Upvote 0
ok ok but my item (button and imageview) is over 50 count my project is shop i load product list from database that is over 50 item and add it into scrollview panel now if activity rotated,then again load product from database
LucaMs Expert Licensed User Longtime User Oct 13, 2014 #8 omidaghakhani1368 said: ok ok but my item (button and imageview) is over 50 count my project is shop i load product list from database that is over 50 item and add it into scrollview panel now if activity rotated,then again load product from database Click to expand... You should fill the items while scrolling (i don't know how, but there are some posts on site about this). However, you could read the data from the DB and store them in a global map or in a file or by using KeyValueStore. Upvote 0
omidaghakhani1368 said: ok ok but my item (button and imageview) is over 50 count my project is shop i load product list from database that is over 50 item and add it into scrollview panel now if activity rotated,then again load product from database Click to expand... You should fill the items while scrolling (i don't know how, but there are some posts on site about this). However, you could read the data from the DB and store them in a global map or in a file or by using KeyValueStore.
omidaghakhani1368 Well-Known Member Licensed User Longtime User May 8, 2015 #9 Erel said: That is correct. The activity is recreated when the orientation changes. However if you are loading any large objects such as bitmaps then you can store them in memory and reuse them. Click to expand... Erel please set Answered Option for each post Upvote 0
Erel said: That is correct. The activity is recreated when the orientation changes. However if you are loading any large objects such as bitmaps then you can store them in memory and reuse them. Click to expand... Erel please set Answered Option for each post