Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

java intent extras

This is what i have been using, hopfully it helps someone.. simple and affective.

send data

    intent = new Intent(getActivity(), CheckinActivity.class);
    intent.putExtra("mealID", meal.Meald);
    startActivity(intent);
get data

    int mealId;

    Intent intent = getIntent();
    Bundle bundle = intent.getExtras();

    if(bundle != null){
        mealId = bundle.getInt("mealID");
    }
cheers!
Comment

PREVIOUS NEXT
Code Example
Java :: how to convert a string to char in java 
Java :: java arraylist remove 
Java :: the main of java 
Java :: Powermockito static method call 
Java :: declare bufferedreader java 
Java :: quarkus maven skip test 
Java :: sort a list with custom comparator java 
Java :: BottomNavigationView only icon 
Java :: java filter array by even numbers 
Java :: spring log info 
Java :: how to create folder java 
Java :: hibernate in spring boot 
Java :: fibonacci series in java 
Java :: java convert pdf to image 
Java :: binary search java 
Java :: set jcombobox index java 
Java :: linked list java 
Java :: how to empty list in java 
Java :: insert data from database sqlite android 
Java :: print all numbers from 1 to n java 
Java :: java hash map 
Java :: java double to float 
Java :: iterate over multi array java 
Java :: Remove an element at a specific index from an array in Java 
Java :: constructor 
Java :: jaccard index two vectors R 
Java :: declaring variables views in java android 
Java :: org.apache.hadoop.mapred.JobClient.runJob(JobClient.java:876) 
Java :: android studio Toast usage 
Java :: how to disable text field java 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =