Fix the crash of BandMode app.
It crashes because of out of array boundary exception. This app predefined a list of constant strings of band mode. Unfortunately the actual supported band modes keep adding and the hardcoded list can meet. Change-Id: Ife9683924706a1606d4f72b01a5904e9aa0f782c
This commit is contained in:
@@ -73,8 +73,6 @@ public class BandMode extends Activity {
|
|||||||
mBandList.setAdapter(mBandListAdapter);
|
mBandList.setAdapter(mBandListAdapter);
|
||||||
mBandList.setOnItemClickListener(mBandSelectionHandler);
|
mBandList.setOnItemClickListener(mBandSelectionHandler);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
loadBandList();
|
loadBandList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,6 +107,7 @@ public class BandMode extends Activity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
if (mBandMode >= BAND_NAMES.length) return "Band mode " + mBandMode;
|
||||||
return BAND_NAMES[mBandMode];
|
return BAND_NAMES[mBandMode];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user