I read the definition of the URI class here and here, but I'm still not sure how I would use an URI object in a android project since the second answer does not address URI in its specific use cases. Does anyone have a better insight on what an URI object can be used for? In what kinds of circumstances should I instantiate an URI object? When is an URI object useful and why should I create one? It would be helpful to have a concrete example. Below is an example I found by creating a blank dialog via Android Studio (factory method provided when one creates).
public void onButtonPressed(Uri uri) {
if (mListener != null) {
mListener.onFragmentInteraction(uri);
}
or
public interface OnFragmentInteractionListener {
void onFragmentInteraction(Uri uri);
}
If the examples above are not helpful you could use your own explanation as when a developer should consider creating an URI object. Thanks.