Commit ed5f6ca8 authored by sword's avatar sword

fix crash

parent 64860d7c
...@@ -190,12 +190,15 @@ public class PickerViewLinkage extends LinearLayout { ...@@ -190,12 +190,15 @@ public class PickerViewLinkage extends LinearLayout {
threeList.clear(); threeList.clear();
threeList = arrayToList(sunArray); threeList = arrayToList(sunArray);
checkItems(loopViewThree, threeList); checkItems(loopViewThree, threeList);
returnData2.setItem(threeList.get(0));
returnData2.setIndex(loopViewThree.getSelectedIndex()); if(threeList!=null&&threeList.size()>0){
if (curSelectedList.size() > 2) { returnData2.setItem(threeList.get(0));
curSelectedList.set(2, returnData2); returnData2.setIndex(loopViewThree.getSelectedIndex());
} else { if (curSelectedList.size() > 2) {
curSelectedList.add(2, returnData2); curSelectedList.set(2, returnData2);
} else {
curSelectedList.add(2, returnData2);
}
} }
loopViewOne.setListener(new OnItemSelectedListener() { loopViewOne.setListener(new OnItemSelectedListener() {
...@@ -230,13 +233,16 @@ public class PickerViewLinkage extends LinearLayout { ...@@ -230,13 +233,16 @@ public class PickerViewLinkage extends LinearLayout {
threeList = arrayToList(sunArray); threeList = arrayToList(sunArray);
checkItems(loopViewThree, threeList); checkItems(loopViewThree, threeList);
returnData2 = new ReturnData(); returnData2 = new ReturnData();
returnData2.setItem(threeList.get(0));
returnData2.setIndex(loopViewThree.getSelectedIndex());
curSelectedList.set(2, returnData2);
if (onSelectedListener != null) { if (threeList!=null&&threeList.size()>0){
onSelectedListener.onSelected(curSelectedList); returnData2.setItem(threeList.get(0));
returnData2.setIndex(loopViewThree.getSelectedIndex());
curSelectedList.set(2, returnData2);
if (onSelectedListener != null) {
onSelectedListener.onSelected(curSelectedList);
}
} }
} }
}); });
...@@ -264,12 +270,18 @@ public class PickerViewLinkage extends LinearLayout { ...@@ -264,12 +270,18 @@ public class PickerViewLinkage extends LinearLayout {
curSelectedList.set(1, returnData1); curSelectedList.set(1, returnData1);
returnData2 = new ReturnData(); returnData2 = new ReturnData();
returnData2.setItem(threeList.get(0));
returnData2.setIndex(loopViewThree.getSelectedIndex()); if (threeList!=null&&threeList.size()>0){
curSelectedList.set(2, returnData2); returnData2.setItem(threeList.get(0));
if (onSelectedListener != null) { returnData2.setIndex(loopViewThree.getSelectedIndex());
onSelectedListener.onSelected(curSelectedList); curSelectedList.set(2, returnData2);
if (onSelectedListener != null) {
onSelectedListener.onSelected(curSelectedList);
}
} }
} }
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment