public void removeCheckedGroceries() { for (Grocery g : mAdapter.getCheckedPositions()) { GroceryList.get().removeGrocery(g); ParseHelper.removeGrocery(g); } updateListView(); }
public ConfigHelper(String configFileName) throws IOException { Properties props = ParseHelper.parseConfigFile(configFileName); this.username = props.getProperty("username"); this.password = props.getProperty("password").toCharArray(); if (props.getProperty("url") != null) { this.url = props.getProperty("url"); } this.proxyUser = props.getProperty("proxyUser"); this.proxyPassword = props.getProperty("proxyPassword"); if (props.getProperty("proxyUrl") != null) { this.proxyUrl = new URL(props.getProperty("proxyUrl")); } if (props.getProperty("proxyPort") != null) { this.proxyPort = Integer.valueOf(props.getProperty("proxyPort")); } if (props.getProperty("ftpHost") != null) { this.ftpHost = props.getProperty("ftpHost"); } if (props.getProperty("ftpPort") != null) { this.ftpPort = Integer.valueOf(props.getProperty("ftpPort")); } if (props.getProperty("ftpUsername") != null) { this.ftpUsername = props.getProperty("ftpUsername"); } if (props.getProperty("ftpPassword") != null) { this.ftpPassword = props.getProperty("ftpPassword"); } if (props.getProperty("devel") != null) { this.devel = Boolean.parseBoolean(props.getProperty("devel")); } }
public void updateListView() { ParseHelper.getGroceryList(getContext()); mAdapter.notifyDataSetChanged(); mGroceries = GroceryList.get().getGroceryList(); mListView = (ListView) getActivity().findViewById(R.id.grocery_list_view); mAdapter = new GroceryListAdapter(getActivity(), R.id.grocery_list_view, mGroceries); mListView.setAdapter(mAdapter); }
@Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = inflater.inflate(R.layout.fragment_grocery_list, container, false); ParseHelper.getGroceryList(getContext()); mGroceries = GroceryList.get().getGroceryList(); mListView = (ListView) v.findViewById(R.id.grocery_list_view); mAdapter = new GroceryListAdapter(getActivity(), R.id.grocery_list_view, mGroceries); mListView.setAdapter(mAdapter); mListView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE); return v; }