Reputation: 377
Is it possible to cache xml design in android? Basically what I wanted is that the first time I load the activity, it loads some data from SQLite database and then displays it on the listview. When I view the activity again, the data displayed on the listview will not load again from the SQLite but instead from the cache of xml design more of like a snapshot of the activity. I want this for a faster performance. Can someone please help me?
Upvotes: 0
Views: 57
Reputation: 5951
Lets say, you want to cache the whole inflated listview which is populated from db during the event of destroying the parent activity, so that in the next time, you don't need to fetch data again i.e. you are looking to reuse previously inflated listview?
If that is the question, no it is not possible & even if it were possible by some hooks or crooks, you must not. As inflated views are highly coupled with context, you try to reuse the inflated views in above described way, then the previous corrupted non-existing context will hopefully gift you a fatal exception.
Upvotes: 2