D DawningTruth Active Member Licensed User Apr 12, 2019 #1 I think this one is a long shot... but here goes... Is there any way to Serialise a Bundle, or to save a bundle to a file or database. I am trying to save the state of a webview for later use. Any help would be much appreciated .
I think this one is a long shot... but here goes... Is there any way to Serialise a Bundle, or to save a bundle to a file or database. I am trying to save the state of a webview for later use. Any help would be much appreciated .
Computersmith64 Well-Known Member Licensed User Longtime User Apr 12, 2019 #2 DawningTruth said: I think this one is a long shot... but here goes... Is there any way to Serialise a Bundle, or to save a bundle to a file or database. I am trying to save the state of a webview for later use. Any help would be much appreciated . Click to expand... According to a reply I read from Erel in another thread, you cannot serialize views. Possibly one way you could do it would be to save references to the contents of the webview, but I'm guessing that might not be an option. - Colin. Upvote 0
DawningTruth said: I think this one is a long shot... but here goes... Is there any way to Serialise a Bundle, or to save a bundle to a file or database. I am trying to save the state of a webview for later use. Any help would be much appreciated . Click to expand... According to a reply I read from Erel in another thread, you cannot serialize views. Possibly one way you could do it would be to save references to the contents of the webview, but I'm guessing that might not be an option. - Colin.
Computersmith64 Well-Known Member Licensed User Longtime User Apr 12, 2019 #3 Actually, this thread might get you pointed in the right direction -> save web page in webview to file (SOS) - Colin. Upvote 0
Actually, this thread might get you pointed in the right direction -> save web page in webview to file (SOS) - Colin.
D DawningTruth Active Member Licensed User Apr 13, 2019 #4 Thx Colin, read through it. The specific challenge I have is I need to save the back forward history. It can be extracted, but not reused. It can be saved into a bundle, but I don't know how to save a bundle in B4A. I have however seen people saving bundles in Android, so I assume there is some way yo do it. Here is the relevant stack overflow article: https://stackoverflow.com/questions/2598248/how-to-serialize-a-bundle Upvote 0
Thx Colin, read through it. The specific challenge I have is I need to save the back forward history. It can be extracted, but not reused. It can be saved into a bundle, but I don't know how to save a bundle in B4A. I have however seen people saving bundles in Android, so I assume there is some way yo do it. Here is the relevant stack overflow article: https://stackoverflow.com/questions/2598248/how-to-serialize-a-bundle
Erel B4X founder Staff member Licensed User Longtime User Apr 14, 2019 #5 It depends on the bundle contents. The code in that link will only serialize simple values. Upvote 0
D DawningTruth Active Member Licensed User Apr 14, 2019 #6 Erel said: It depends on the bundle contents. The code in that link will only serialize simple values. Click to expand... Thx Erel, any suggestions on how I could save one of those webview bundles? Upvote 0
Erel said: It depends on the bundle contents. The code in that link will only serialize simple values. Click to expand... Thx Erel, any suggestions on how I could save one of those webview bundles?
Erel B4X founder Staff member Licensed User Longtime User Apr 14, 2019 #7 You need to first understand which objects were added to the bundle. Use the debugger to find the bundle keys and values. Upvote 0
You need to first understand which objects were added to the bundle. Use the debugger to find the bundle keys and values.
D DawningTruth Active Member Licensed User Apr 14, 2019 #8 Erel said: You need to first understand which objects were added to the bundle. Use the debugger to find the bundle keys and values. Click to expand... Thx Erel, Ok, I have setup a little project which puts some history into a webview and then saves its state into a bundle. Here is a screenshot from the debugger: I assume you would want to copy that mArray into a list and then save it to a list and then restore to a new bundle when needed. The question is: 1. How do you access the mArray? 2. How do you copy to the mArray of the new bundle? They both look like they are protected variables. Upvote 0
Erel said: You need to first understand which objects were added to the bundle. Use the debugger to find the bundle keys and values. Click to expand... Thx Erel, Ok, I have setup a little project which puts some history into a webview and then saves its state into a bundle. Here is a screenshot from the debugger: I assume you would want to copy that mArray into a list and then save it to a list and then restore to a new bundle when needed. The question is: 1. How do you access the mArray? 2. How do you copy to the mArray of the new bundle? They both look like they are protected variables.
Erel B4X founder Staff member Licensed User Longtime User Apr 14, 2019 #9 Saving it to a list will not help. You need to serialize it to an array of bytes. I don't see how you can do it with this bundle. Upvote 0
Saving it to a list will not help. You need to serialize it to an array of bytes. I don't see how you can do it with this bundle.
D DawningTruth Active Member Licensed User Apr 14, 2019 #10 Erel said: Saving it to a list will not help. You need to serialize it to an array of bytes. I don't see how you can do it with this bundle. Click to expand... Thx Erel, ok I will have to accept this technical limitation and try a slightly less functional workaround. Well at least we tried . Thx anyways. Upvote 0
Erel said: Saving it to a list will not help. You need to serialize it to an array of bytes. I don't see how you can do it with this bundle. Click to expand... Thx Erel, ok I will have to accept this technical limitation and try a slightly less functional workaround. Well at least we tried . Thx anyways.