android - Android工作室货币转换器编码
问题描述
我正在尝试在 android studio 中制作货币转换器应用程序,但我无法在模拟器中启动我的应用程序,我相信这是因为编码中的一些错误。我将在这里复制我的代码,以便您帮助我,我将不胜感激。对不起,我的英语不好 :)
public class MainActivity extends AppCompatActivity {
public void clickFunction(View view) {
Log.i ("Info", "Button pressed");
EditText editText = (EditText) findViewById(editText);
Log.i( "Values" ,editText,getText().toString());
String amountInEuros = editText.getText()
Log.i("Info" , String.valueOf(editText.getText()));
String getAmountInEuros ;
double amountInEuros double = double.parsedouble (amountInEuros);
double amountInDollars double = double amountInEuros double * 1.08 ;
String amountInDollars String = double.toString (amountInDollars double)
Log.i("Amount in Dollars", amountInDollars String);
Toast.makeText ( this , amountInEuros + "Euros" + "is" + amountInDollars String , LENGTH_LONG );
}
解决方案
这些行缺少分号:
String amountInEuros = editText.getText();
String amountInDollars String = double.toString (amountInDollars double);
推荐阅读
- c - 为什么不是负数运算符给出了这个输出
- javascript - 如何使用 findOne 方法查询 mongoose 以查找一件事或另一件事
- android - 对 DataSource 进行排序不会对屏幕上的可见列表进行排序
- r - 仅提取具有 R 中列值的唯一组合的行
- r - 如何根据多列条件对数据进行排序
- java - 如何在 Spring Web 应用程序中找到 application.properties,而位置被提及为 classpath:/application.properties 但文件丢失?
- jquery - 当zapier触发webhook时,Ajax jquery POST命令不在webhook中执行
- php - 使额外的搜索查询实现 OR 而不是 AND
- c# - 这个异常格式化函数在内置的 ToString() 方法上添加了什么值
- python-3.x - 带有 datetime mofule 的 python 程序