Back to project page ingress-key-counter.
The source code is released under:
MIT License
If you think the Android project ingress-key-counter listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package de.lehrbaum.keycounter; // w w w .ja va2 s .c om import android.content.Context; /** * This list encapsulates a list of portals and updates changes to the database. */ public class PortalList extends AbstractEncapsuledList<Portal> { protected Category cat; public PortalList(Context c, Category cat) { this(new DatabaseHandler(c), cat); } public PortalList(DatabaseHandler dh, Category cat) { super(dh, dh.getPortals(cat.getId())); this.cat = cat; } @Override protected void onAdd(Portal p) { dh.addPortalToCategory(p.getId(), cat.getId()); } @Override protected void onRemove(Portal p) { dh.deletePortal(p.getId(), cat.getId()); } public void changeCategory(Category cat) { internalList = dh.getPortals(cat.getId()); this.cat = cat; } }