public Diff(final OpdsSettings olds, final OpdsSettings news) { firstTime = olds == null; if (firstTime) { mask = 0xFFFFFFFF; } else if (news != null) { if (!olds.opdsCatalogs.equals(news.opdsCatalogs)) { mask |= D_OpdsCatalogs; } } }
public boolean equals(Object object) { return jsonArray.equals(object); }
private ArrayList<QuestionData> parseJSONResponseQuestion(JSONArray response) { if (!response.equals("")) { ArrayList<QuestionData> questionDataArrayList = new ArrayList<>(); try { StringBuilder data = new StringBuilder(); for (int i = 0; i < response.length(); i++) { JSONObject currentQuestions = response.getJSONObject(i); String text = currentQuestions.getString("text"); String votes = currentQuestions.getString("votes"); int voteInt=Integer.parseInt(votes); QuestionData questionData = new QuestionData(); questionData.setMtext(text); questionData.setVotes(votes); recyclerAdapter.setBlogItem(i, questionData); /// Put attention here! } System.out.println(data.toString()); } catch (JSONException e) { e.printStackTrace(); } } return mListblogs; }
Timer timerTask = new Timer(); timerTask.schedule(new TimerTask() { @Override public void run() { // Get the new data from the server GetURLContentTask eu = new GetURLContentTask(); String JSONString = eu.execute(url).get(); System.out.println("debug h " + JSONString); JSONArray jArray = new JSONArray(JSONString); System.out.println("debug *****JARRAY*****"+jArray.length()); if (!jArray.equals(null)) { for(int i=0;i<jArray.length();i++){ JSONObject json_data = jArray.getJSONObject(i); System.out.println("debug unique id : " + json_data.getString("unique_id") + ", point de vente : " + json_data.getString("pdv") + ", panier : " + json_data.getString("panier")); DummyContent.addItem(new DummyContent.DummyItem(json_data.getString("unique_id"), json_data.getString("pdv"), json_data.getString("panier"))); // Clear the older data and set the new data adapter.clear(); adapter.addAll(DummyContent); adapter.notifyDataSetChanged(); } } } }, 10000, 10000);
if (!response.equals("")) { try { StringBuilder data = new StringBuilder();
if (!response.equals("")) {