Closed Cornholio2108 closed 4 years ago
@Override
public void onMapsFinished() {
Log.d(TAG, "onMapsFinished: ");
View view = getView().findViewById(R.id.incTraffic);
EditText etTraffic = view.findViewById(R.id.etValue);
//etTraffic.setText(destinationList.get(myPrefs.getInt(SP_SELECTED_DESTINATION,0)).name);
//replace with:
if(destinationList.size()>myPrefs.getInt(SP_SELECTED_DESTINATION,0))
etTraffic.setText(destinationList.get(myPrefs.getInt(SP_SELECTED_DESTINATION,0)).name);
else
etTraffic.setText("Select destination");
}
Fixed
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at java.util.ArrayList.get(ArrayList.java:437) at com.awake.cornholio.awake.fragments.FragNewAlarm.onMapsFinished(FragNewAlarm.java:892) at com.awake.cornholio.awake.fragments.MapFragment$2.onClick(MapFragment.java:228)