I think you are a starter, and just copied the code without knowing it even. So let me get it straight forward to you.
//Actual toast
Toast.makeText(MyCalcActivity.this, message, Toast.LENGTH_LONG).show();
// Exaplaining toast
Toast.makeText(1, 2, 3).show();
In first parameter
1
, it is the activity where the toast will be shown. Like you see in your code, it isMyCalcActivity.this
which means it is your current activity because of the input ofthis
.In the second parameter
2
, it is what you want to be shown. See in your code you have usedmessage
and from your code, we can know that message is astring
that has the value of aneditText
you have that is calledinputOne
. But you don't want that, right? You want the value of thetextView resultTxt
so why you are usingmessage
?! Replacemessage
withresultText.getText()
to get the value of thetextview
you want.In the last parameter, which is
3
. It is the length of thetoast message
. How long do you want it? That what it is for. In you code it is set for Long toast message which I think it is about 3 seconds. If you want a shorter one, useToast.LENGTH_SHORT
or a customized duration.
So at the end, This is your wanted code.
Toast.makeText(MyCalcActivity.this, resultTxt.getText().toString(), Toast.LENGTH_LONG)
.show();
Sorry for taking too long, but loved to help you. We all started from the bottom. But please next time search before you ask, there are a lot of similar questions and answers explaining them like this.