@Override public void onItemAdded(String key, String value) { key = TextUtils.replace(key, new String[]{DELIMETER, SEPARATOR}, new String[]{"", ""}).toString(); value = TextUtils.replace(value, new String[]{DELIMETER, SEPARATOR}, new String[]{"", ""}).toString(); Parcelable[] parcelables = mCurrentRestrictions.getParcelableArray(RESTRICTION_KEY_ITEMS); Map<String, String> items = new HashMap<>(); if (parcelables != null) { for (Parcelable parcelable : parcelables) { Bundle bundle = (Bundle) parcelable; items.put(bundle.getString(RESTRICTION_KEY_ITEM_KEY), bundle.getString(RESTRICTION_KEY_ITEM_VALUE)); } } items.put(key, value); insertItemRow(LayoutInflater.from(getActivity()), key, value); saveItems(getActivity(), items); }
private String createSQL(List<Firework> data) { Firework firework = data.get(0); return TextUtils.replace( DatabaseConstants.RawSql.BULK_INSERT_FIREWORKS, new String[]{"Times", "Na", "Co", "No", "Ft", "Pr", "Sh"}, new CharSequence[]{ String.valueOf(data.size()), firework.getName(), firework.getColor(), firework.getNoise(), firework.getType(), String.valueOf(firework.getPrice()), "1" }).toString(); }
private String createSQL(List<Firework> data) { Firework firework = data.get(0); return TextUtils.replace( DatabaseConstants.RawSql.BULK_INSERT_FIREWORKS, new String[]{"Times", "Na", "Co", "No", "Ft", "Pr", "Sh"}, new CharSequence[]{ String.valueOf(data.size()), firework.getName(), firework.getColor(), firework.getNoise(), firework.getType(), String.valueOf(firework.getPrice()), "1" }).toString(); }
private String createSQL(Firework data) { return TextUtils.replace( DatabaseConstants.RawSql.INSERT_FIREWORK, new String[]{"Na","Co","No", "Ft", "Pr","Sh"}, new CharSequence[]{data.getName(), data.getColor(), data.getNoise(), data.getType(), String.valueOf(data.getPrice()), "1"}) .toString(); }
chunk = TextUtils.replace(chunk, CHUNK_SOURCES, CHUNK_REPLACEMENTS);