-4
私はこの配列arraylistに配列を追加して結果を得るには?
double[] priceInDouble={89.35, 55.95, 95.90, 60.00, 116.55, 75.10, 47.00, 18.05};
からaddedPrices ArrayListに要素を追加し、次のコードと同じのArrayListの合計が、運を取得しようとしています。
ArrayList<Double> addedPrices = new ArrayList<Double>();
for(int i = 0; i < 1 ; i++) {
addedPrices.add(i,priceInDouble[position]);
double price = 0;
for (double d : addedPrices){
price +=d;
TextView textView = (TextView)activity.findViewById(R.id.counter_text);
textView.setText(NumberFormat.getInstance().format(price));
textView.setInputType(InputType.TYPE_NUMBER_FLAG_SIGNED);
}
}
投稿する前にスタックオーバーフローを検索してください。 –