Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

android studio pass value to another activity

Intent i = new Intent(this, ActivityTwo.class);
AutoCompleteTextView textView = (AutoCompleteTextView) findViewById(R.id.autocomplete);
String getrec=textView.getText().toString();

//Create the bundle
Bundle bundle = new Bundle();

//Add your data to bundle
bundle.putString(“stuff”, getrec);

//Add the bundle to the intent
i.putExtras(bundle);

//Fire that second activity
startActivity(i);
Comment

android studio pass value to another activity

//Get the bundle
Bundle bundle = getIntent().getExtras();

//Extract the data…
String stuff = bundle.getString(“stuff”); 
Comment

PREVIOUS NEXT
Code Example
Java :: How to count the number of islands (groups of adjacent 1s) in a grid of 1s (land) and 0s (water), in Java? 
Java :: java read directory 
Java :: android list index 
Java :: for loop java 
Java :: java string remove character 
Java :: add view to relativelayout programmatically 
Java :: java list distinct by key 
Java :: lambda comparator java 
Java :: java quotes in string 
Java :: java return tuple 
Java :: how to use deque as queue in java? 
Java :: awk print second 
Java :: convert char to string in java 
Java :: square root of a number in java without sqrt 
Java :: pretty print json in console 
Java :: java remove character from string after 
Java :: how to assert that an exception is thrown java 
Java :: java remove last character 
Java :: how to modify string in java 
Java :: main method 
Java :: viewpager2 dependency 
Java :: How to find the logged-in user in Spring Boot? 
Java :: Java Create ArrayList in Java 
Java :: default argument in java 
Java :: spigot dispatchcommand 
Java :: android sqlite select query 
Java :: this in java 
Java :: how to change actionbar color in android programmatically 
Java :: java formatted output 
Java :: java final meaning 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =