Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kache ,Gson , Cant Convert it Back To Kache Object , build Error #289

Open
blackholeearth opened this issue Nov 18, 2024 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@blackholeearth
Copy link

after i restart the i app i want to access same memory cache.

is it possible??

@blackholeearth blackholeearth added the enhancement New feature or request label Nov 18, 2024
@blackholeearth
Copy link
Author

blackholeearth commented Nov 20, 2024

i am trying convert Kache to json , and reverse .
but i get buildError: Only classes are allowed on the left hand side of a class literal

code:

 
    fun save_Kache(kacheobj: InMemoryKache<List<Int>,List<Media>>) {
        sharedPref.edit().putString("kacheobj", Gson().toJson(kacheobj)).apply()
    }

    fun get_Kache(): InMemoryKache<List<Int>, List<Media>>? {
        val data = sharedPref.getString("kacheobj", null)
        if (data == null) {
            return null
        }
        return Gson().fromJson(data, InMemoryKache<List<Int>,List<Media>>::class.java) //buildError:
    }

@blackholeearth blackholeearth changed the title Persistent Version of Memory Cache Kache ,Gson , Cant Convert it Back To Kache Object , build Error Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant