开发者

Text inserted in the edittext is overwritten

I'm a beginner and am making a calculator (fairly easy), but it's happening the following p开发者_Python百科roblem: When Cline in "1" button for example, he enters this number in the EditText, but if you click again the number is overwritten instead of the inserted his side as desired. How do the numbers were placed side by side without overwriting those already there?

Note: The layout of buttons and etc. I did in. XML, so I'm not using the keyboard native Android.

Thanks!


when you want to add a new number next to the old one, you probably need to

  1. get the value that is currently being shown in this "edit text" and save it in a string
  2. concatenate this old value with the new one that you want to add to your "edit text"
  3. set this new concatenated value as the new text in your "edit text"

:)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜