1
我想從onPostexecute
方法獲得onNewIntent
方法中的意圖後,顯示AlertBuild對話框。 routeList
[1,9,13]。目前,我得到這個錯誤java.lang.ArrayStoreException: source[0] of type java.lang.Integer cannot be stored in destination array of type java.lang.CharSequence[]
類型java.lang.Integer的source [0]不能存儲在java.lang.CharSequence類型的目標數組中[]
ArrayList<Integer> routeList = extras
.getIntegerArrayList("stop_route"); //[1,9,13]
int routeListSize = routeList.size();
if(routeListSize > 0){
CharSequence charSequence[] = routeList
.toArray(new CharSequence[routeList.size()]);
for (int i = 0, size = routeList.size(); i < size; i++) {
charSequence[i] = String.valueOf(routeList.get(i));
}
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("Select");
builder.setMultiChoiceItems(charSequence, null,
new DialogInterface.OnMultiChoiceClickListener() {
@Override
public void onClick(DialogInterface dialog, int which,
boolean isChecked) {
// TODO Auto-generated method stub
}
});
}