Created
March 3, 2017 14:10
-
-
Save meditat/c81d98040dc4aa990f6bcd327496e28c to your computer and use it in GitHub Desktop.
how to directy use on click option in xml on android studio
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 int counter=0 ; | |
public void submitOrder(View view){ | |
counter++; | |
displayPri(counter); | |
displayQty(counter); | |
} | |
public void displayPri(int counter){ | |
int coff=5; | |
TextView pri=(TextView)findViewById(R.id.price_text_view); | |
counter=5*counter; | |
String p=Integer.toString(counter); | |
pri.setText("$"+p); | |
} | |
public void displayQty(int counter){ | |
TextView qty =(TextView)findViewById(R.id.quantity_text_view); | |
String s=Integer.toString(counter); | |
qty.setText(s); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment