Created
November 11, 2016 23:03
-
-
Save suciptoid/bdefd727410179bca97c6fbb2d8d6c8c to your computer and use it in GitHub Desktop.
Indonesia Android Kejar #2 Beginner : Code snippet MainActivity.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainActivity extends AppCompatActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
} | |
// Membuat handler click tombol order | |
public void submitOrder(View view){ | |
// Panggil Fungsi saat tombol di klik | |
displayOrder(2); | |
} | |
// Aksi untuk menampilkan order | |
private void displayOrder(int number){ | |
// Cari TextView berdasarkan ID di layout | |
TextView quantityOrderText = (TextView) findViewById(R.id.text_quantity); | |
// Ubah Text | |
quantityOrderText.setText(""+number); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment