Advertisement
Guest User

Untitled

a guest
Mar 26th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. public class MainActivity extends AppCompatActivity {
  2.  
  3. private int money;
  4.  
  5. @Override
  6. protected void onCreate(Bundle savedInstanceState) {
  7. super.onCreate(savedInstanceState);
  8. setContentView(R.layout.activity_main);
  9. money = 0;
  10. setText();
  11. }
  12.  
  13. public void onclick(View view) {
  14. money = +100;
  15. }
  16.  
  17. public void setText() {
  18. TextView moneyView = (TextView) findViewById(R.id.money_view);
  19. int mon = money;
  20. String money = String.format("%08d%", mon);
  21. moneyView.setText(money);
  22. }
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement