Skip to content

Commit

Permalink
fixed the duplicate select options issue in panchayt & village list
Browse files Browse the repository at this point in the history
  • Loading branch information
linconcandoit committed Oct 23, 2024
1 parent cdaa8ba commit 105b030
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,10 @@ private void setBlockAdapter(List<Block> blocks) {

private void setGramPanchayatAdapter(List<GramPanchayat> gramPanchayats) {
Log.v(TAG, "setGramPanchayatAdapter =>" + new Gson().toJson(gramPanchayats));
GramPanchayat defaultGP = new GramPanchayat(getResources().getString(R.string.select_spinner), null, null);
gramPanchayats.add(0, defaultGP);
if (gramPanchayats.size() > 0 && !Objects.equals(gramPanchayats.get(0).getName(), getResources().getString(R.string.select_spinner))) {
GramPanchayat defaultGP = new GramPanchayat(getResources().getString(R.string.select_spinner), null, null);
gramPanchayats.add(0, defaultGP);
}
// String[] gpList = new String[gramPanchayats.size() + 1];
// gpList[0] = getResources().getString(R.string.select_spinner);
// for (int i = 1; i <= gramPanchayats.size(); i++) {
Expand Down Expand Up @@ -466,7 +468,8 @@ private void setGramPanchayatAdapter(List<GramPanchayat> gramPanchayats) {

private void setVillageAdapter(List<Village> villages) {
Log.v(TAG, "setVillageAdapter =>" + new Gson().toJson(villages));
villages.add(0, new Village(getResources().getString(R.string.select_spinner), null));
if (villages.size() > 0 && !Objects.equals(villages.get(0).getName(), getResources().getString(R.string.select_spinner)))
villages.add(0, new Village(getResources().getString(R.string.select_spinner), null));
// String[] gpList = new String[villages.size() + 1];
// gpList[0] = getResources().getString(R.string.select_spinner);
// for (int i = 1; i <= villages.size(); i++) {
Expand Down

0 comments on commit 105b030

Please sign in to comment.