Skip to content

Commit 7632832

Browse files
committed
End of video 8
1 parent 65b8c39 commit 7632832

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

.idea/workspace.xml

Lines changed: 5 additions & 13 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: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
4343
super.onActivityResult(requestCode, resultCode, data);
4444

4545
if (resultCode == RESULT_OK) {
46-
if (requestCode == REQUEST_TAKE_PHOTO) {
46+
if (requestCode == REQUEST_TAKE_PHOTO || requestCode == REQUEST_PICK_PHOTO) {
47+
if (data != null) {
48+
mMediaUri = data.getData();
49+
}
50+
4751
Intent intent = new Intent(this, ViewImageActivity.class);
4852
intent.setData(mMediaUri);
4953
startActivity(intent);
@@ -92,7 +96,9 @@ void takeVideo() {
9296

9397
@OnClick(R.id.pickPhoto)
9498
void pickPhoto() {
95-
99+
Intent pickPhotoIntent = new Intent(Intent.ACTION_GET_CONTENT);
100+
pickPhotoIntent.setType("image/*");
101+
startActivityForResult(pickPhotoIntent, REQUEST_PICK_PHOTO);
96102
}
97103

98104
@OnClick(R.id.pickVideo)

0 commit comments

Comments
 (0)