Skip to content

Commit e39a6a2

Browse files
committed
End of video 9
1 parent 7632832 commit e39a6a2

File tree

2 files changed

+27
-6
lines changed

2 files changed

+27
-6
lines changed

.idea/workspace.xml

Lines changed: 17 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/src/main/java/com/teamtreehouse/cameraworkshop/MainActivity.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@ else if (requestCode == REQUEST_TAKE_VIDEO) {
5757
intent.setDataAndType(mMediaUri, "video/*");
5858
startActivity(intent);
5959
}
60+
else if (requestCode == REQUEST_PICK_VIDEO) {
61+
if (data != null) {
62+
Log.i(TAG, "Video content URI: " + data.getData());
63+
Toast.makeText(this, "Video content URI: " + data.getData(),
64+
Toast.LENGTH_LONG).show();
65+
}
66+
}
6067
}
6168
else if (resultCode != RESULT_CANCELED) {
6269
Toast.makeText(this, "Sorry, there was an error!", Toast.LENGTH_LONG).show();
@@ -103,7 +110,9 @@ void pickPhoto() {
103110

104111
@OnClick(R.id.pickVideo)
105112
void pickVideo() {
106-
113+
Intent pickVideoIntent = new Intent(Intent.ACTION_GET_CONTENT);
114+
pickVideoIntent.setType("video/*");
115+
startActivityForResult(pickVideoIntent, REQUEST_PICK_VIDEO);
107116
}
108117

109118
private Uri getOutputMediaFileUri(int mediaType) {

0 commit comments

Comments
 (0)