DEV Community

HarmonyOS
HarmonyOS

Posted on

[Sports Watch] [API 6] Use the storage.get Method to Retrieve Saved Data, But the Retrieval Fails

Read the original article:[Sports Watch] [API 6] Use the storage.get Method to Retrieve Saved Data, But the Retrieval Fails

Question

When using the storage.set method to save an array of index data in a table, the saving is successful. However, when using storage.get to retrieve the data, although the retrieval is successful, the data is not displayed.

Answer

The data that can be saved using storage.set can only be strings, not numbers. Save the array after converting it's index into a string.

Written by Muaz Kartal

Top comments (0)