java.lang.Object | ||
↳ | sofia.app.internal.AbsActivityStarter | |
↳ | sofia.content.ContentViewer |
Presents a full-screen viewer for content on the device. The content to
display is denoted by its Uri
; it can be any kind of content that
supports the ACTION_VIEW
intent, such as an image, video, sound,
contact card, and many others.
This class should be used from an event handler in a Screen-like
class. Display the content by calling the start(Activity)
method. When the user returns from viewing the content, the
contentViewerFinished
method will be called on the screen, if it
exists. For example:
public class MyScreen extends Screen { public void buttonClicked() { new ContentViewer(uri).start(this); } public void contentViewerFinished(ContentViewer viewer) { // Do something when the viewer closes, if desired. } }
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ContentViewer(Uri uri)
Initializes a new content viewer that will display the content at the
specified
Uri . |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Uri |
getUri()
Gets the
Uri of the content that will be displayed by this
viewer. | ||||||||||
void |
setUri(Uri newUri)
Sets the
Uri of the content that will be displayed by this
viewer. | ||||||||||
void |
start(Activity owner, String method)
Starts the content viewer.
| ||||||||||
void |
start(Activity owner)
Starts the content viewer.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | getDefaultCallback() |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
sofia.app.internal.AbsActivityStarter
| |||||||||||
From class
java.lang.Object
|
Starts the content viewer. When the user dismisses the viewer, the
owning Activity
(or Screen
) will have the method with
the name specified by method
called.
owner | the activity or screen that owns this content viewer and will receive a notification when it is dismissed |
---|---|
method | the name of the method that will be called on
owner when the content viewer is dismissed
|
Starts the content viewer. When the user dismisses the viewer, the
owning Activity
(or Screen
) will have its
contentViewerFinished
method called.
owner | the activity or screen that owns this content viewer and will receive a notification when it is dismissed |
---|