【问题标题】:Android studio Currency converter codingAndroid工作室货币转换器编码
【发布时间】:2020-09-01 18:31:36
【问题描述】:

我正在尝试在 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 );
    }

【问题讨论】:

  • 你能发布错误吗?
  • 提供您在 Logcat 中遇到的错误。
  • 我收到错误“;”预期, 预期,但我不知道如何处理这些错误

标签: android currency converters


【解决方案1】:

这些行缺少分号:

String amountInEuros = editText.getText();

String amountInDollars String = double.toString (amountInDollars double);

【讨论】:

    猜你喜欢
    • 2014-08-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多