Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MainActivity extends AppCompatActivity {
- private int money;
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- money = 0;
- setText();
- }
- public void onclick(View view) {
- money = +100;
- }
- public void setText() {
- TextView moneyView = (TextView) findViewById(R.id.money_view);
- int mon = money;
- String money = String.format("%08d%", mon);
- moneyView.setText(money);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement