I tried to pass numbers that would be inserted into 3 editTexts for 3 long variables I created: l01, l02, l03
. In order to work them out and make a very simple account.
MainActivity.java:
package genesysgeneration.treerule;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.EditText;
import android.widget.TextView;
public class MainMenuActivity extends AppCompatActivity {
private EditText et01, et02, et03;
private TextView tv01;
private long l01, l02, l03;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main_menu);
l01=0;
l02=0;
l03=0;
et01=(EditText)findViewById(R.id.et01);
et02=(EditText)findViewById(R.id.et02);
et03=(EditText)findViewById(R.id.et03);
l01=et01;
l02=et02;
l03=et03;
tv01=(TextView)findViewById(R.id.tv01);
tv01.setText(l01*l02*l03);
}
}
I also changed the 3 inputType of the 3 editTexts to number | numberDecimal :
What did I do wrong, or what did I fail to do? The program did not even run errors in the following lines:
l01=et01;
l02=et02;
l03=et03;
tv01.setText(l01*l02*l03);