Reputation: 367
I have loads of HTML pages, and when users click a certain button, one of the HTML pages open, I have also created a ListView sort of like an Index page, now I already added a Bookmark / Add to Favorites button to the layout of the WebView, I want it that when the Bookmark button is clicked, it adds the current page to "Bookmark" which can be accessed from the main activity.
Main Activity - User Select Page - Page Opens - User Click Bookmark Button on Page - Page is Added to Bookmark
The "Favorites" activity has a ListView layout, How do I make this work?
Upvotes: 0
Views: 2056
Reputation:
Easiest Practice is to add a boolean to your DTO. call it something like favorite. when the user clicks the bookmark/favorite button call the setFavorite method and set it to true. and at the beginning of your FavoritesActivity check for those items in your list that have the isFavorite set to true. Store them is another List and feed that List to your ListView's Adapter.
Upvotes: 1