我的問題是這樣的:字符串+雙在AlertDialog
Double result = SubActivity.this.resultado(SubActivity.this.num1, SubActivity.this.pes1, SubActivity.this.num2, SubActivity.this.pes2,
SubActivity.this.num3, SubActivity.this.pes3,
SubActivity.this.num4, SubActivity.this.pes4,
SubActivity.this.num5, SubActivity.this.pes5);
AlertDialog.Builder builder = new AlertDialog.Builder(SubActivity.this);
builder.setIcon(R.drawable.ic_launcher);
builder.setTitle(R.string.result);
builder.setMessage(R.string.n + result);
builder.setPositiveButton("OK", null);
builder.show();
return;
但我得到了一個錯誤:
There is no applicable method to '(double)'
如何,我可以添加字符串?
如果你的目的是連接導致R.string.n,你可以使用的getString(R.string.n)+導致 – Blackbelt
任職:d感謝黑帶 – Crimeiaman