I'm trying to get my application to calculate the fields% cos_de% cost price plus profit percentage and when clicking on the sale price field the result will appear, however instead of appearing the result the following message appears in edit text of the field:
android.widget.EditText@41f
Thank you to anyone who can help as specifically as possible because I have no experience.
OnFocusChangeListener focusListener = new View.OnFocusChangeListener() {
public void onFocusChange(View v, boolean hasFocus) {
if (!hasFocus) {
custo = MonetaryMask.stringMonetarioToDouble(edPrecoDeCusto.getText().toString());
lucro = MonetaryMask.stringMonetarioToDouble(edPercDeLucro.getText().toString());
venda = MonetaryMask.stringMonetarioToDouble(edPrecoDeVenda.getText().toString());
venda = calcularLucro(custo, lucro);
edPrecoDeVenda.setText(edPrecoDeVenda.toString());
}
}
};
edPercDeLucro.setOnFocusChangeListener(focusListener);
private double calcularLucro(double custo, double lucro) {
venda = custo + lucro / 100 * custo;
return venda;
}