View view;
if (convertView == null) {
view = mInflater.inflate(R.layout.history_item, parent, false);
} else {
view = convertView;
}
TextView expr = (TextView) view.findViewById(R.id.historyExpr);
TextView result = (TextView) view.findViewById(R.id.historyResult);
HistoryEntry entry = mEntries.elementAt(position);
String base = entry.getBase();
expr.setText(entry.getBase());
try {
String res = mEval.evaluate(base);
result.setText("= " + res);
} catch (SyntaxException e) {
result.setText("");
}
return view;