AbsActivityStarter
java.lang.Object
AbsActivityStarter
Allows the user to take a photo using the camera on his or her device.
This class should be used from an event handler in a Screen
subclass. Display the camera by calling the start(Activity)
method. When a photo is taken and saved, the photoWasTaken
method
will be called on the screen, if it exists. For example:
public class MyScreen extends Screen { public void buttonClicked() { PhotoCamera camera = new PhotoCamera(); camera.start(this); } public void photoWasTaken(PhotoCamera camera) { // Do something with the image by calling camera.getBitmap(), // camera.getUri(), or camera.getPath(). } }
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
PhotoCamera()
Initializes a new photo camera.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Bitmap
|
getBitmap()
A convenience method that returns the photo as a
Bitmap . | ||||||||||
String
|
getPath()
Gets the file system path of the photo that was taken by the camera.
| ||||||||||
Uri
|
getUri()
Gets the Uri (uniform resource identifier) of the photo that was
taken by the camera.
| ||||||||||
void
|
handleActivityResult(Activity owner, Intent data, int requestCode, int resultCode)
| ||||||||||
void
|
start(Activity owner, String callback)
Displays the camera application.
| ||||||||||
void
|
start(Activity owner)
Displays the camera application.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String
|
getDefaultCallback()
|
Methods inherited from
class
java.lang.Object
| |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Object
|
clone()
| ||||||||||
boolean
|
equals(Object arg0)
| ||||||||||
void
|
finalize()
| ||||||||||
final
Class<?>
|
getClass()
| ||||||||||
int
|
hashCode()
| ||||||||||
final
void
|
notify()
| ||||||||||
final
void
|
notifyAll()
| ||||||||||
String
|
toString()
| ||||||||||
final
void
|
wait()
| ||||||||||
final
void
|
wait(long arg0, int arg1)
| ||||||||||
final
void
|
wait(long arg0)
|
Initializes a new photo camera.
A convenience method that returns the photo as a Bitmap
.
a Bitmap
that represents the photo that was taken
Gets the file system path of the photo that was taken by the camera.
the file system path of the photo that was taken
Gets the Uri (uniform resource identifier) of the photo that was taken by the camera.
the Uri of the photo that was taken
Displays the camera application. When the user has taken a photo, the
owning Activity
(or Screen
) will have the method with
the name specified by method
called.
Displays the camera application. When the user has taken a photo, the
owning Activity
(or Screen
) will have its
photoWasTaken
method called.