I am working on an android application that pulls data from a Database. I want to pass data
between activities (A single String). I initially implemented the data passing using the Bundle feature. However, I came across the Application class which allows a variable to be accessed from any activity.
Which would you recommend using for moving data between activities?
public class MyVideo extends Application {
private String url ="NULL";
public String getUrl(){
return url;
}
public void setUrl(String newurl){
url = newurl;
}
}
This is similar to this question What is a "bundle" in an Android application, which contains a comprehensive answer with example.
My answer would be that you would use a bundle as this is what they were designed for and are easy enough to use. The bundle supports a String without any extra work being done so I would argue it makes it ideal.
Adding to intent
Retrieving: