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:
Derek Tan
2014-04-25 16:47:54 -07:00
parent 1102f76e58
commit eb4575e8c2

View File

@@ -58,7 +58,7 @@ public class BandMode extends Activity {
super.onCreate(icicle);
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
setContentView(R.layout.band_mode);
setTitle(getString(R.string.band_mode_title));
@@ -73,8 +73,6 @@ public class BandMode extends Activity {
mBandList.setAdapter(mBandListAdapter);
mBandList.setOnItemClickListener(mBandSelectionHandler);
loadBandList();
}
@@ -109,6 +107,7 @@ public class BandMode extends Activity {
}
public String toString() {
if (mBandMode >= BAND_NAMES.length) return "Band mode " + mBandMode;
return BAND_NAMES[mBandMode];
}
}