Back to project page open311-android.
The source code is released under:
GNU General Public License
If you think the Android project open311-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
/** * @copyright 2012 City of Bloomington, Indiana * @license http://www.gnu.org/licenses/gpl.txt GNU/GPL, see LICENSE.txt * @author Cliff Ingham <inghamn@bloomington.in.gov> *//*w ww .j a v a2 s . c o m*/ package gov.in.bloomington.georeporter.fragments; import gov.in.bloomington.georeporter.adapters.ServicesAdapter; import java.util.ArrayList; import gov.in.bloomington.georeporter.util.json.JSONObject; import android.app.Activity; import android.app.ListFragment; import android.view.View; import android.widget.ListView; public class ChooseServiceFragment extends ListFragment { private static OnServiceSelectedListener mListener; private static ArrayList<JSONObject> mServices; public interface OnServiceSelectedListener { public void onServiceSelected(JSONObject service); } public void setServices(ArrayList<JSONObject> services) { mServices = services; } @Override public void onAttach(Activity activity) { super.onAttach(activity); setListAdapter(new ServicesAdapter(mServices, activity)); mListener = (OnServiceSelectedListener)activity; } @Override public void onListItemClick(ListView l, View v, int position, long id) { super.onListItemClick(l, v, position, id); mListener.onServiceSelected(mServices.get(position)); } }