Your Question: How Can I Get Integer Value from One Activity to Another in Android?
Contents How Do I Transfer an Integer from One Activity to Another in Android? putString(“StringVariableName”, intValue + “”); Intent. putExtras(extras)...
Contents
How do I transfer an integer from one activity to another in Android?
putString(“StringVariableName”, intValue + “”); intent. putExtras(extras); startActivity(intent); The code above will pass your integer value as a string to class B. On class B, get the string value and convert again as an integer as shown below.
How can I get variable from one activity to another in Android?
These operations are as follows:
- first Add the listener on send button and this button will send the data. …
- Now create the String type variable for store the value of EditText which is input by user. …
- Now create the Intent object First_activity. …
- Put the value in putExtra method in key value pair then start the activity.
12 дек. 2019 г.