@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (savedInstanceState == null) { fragment = CreateStoryFragment.newInstance(); fragment.setArguments(getIntent().getExtras()); getSupportFragmentManager().beginTransaction().add(android.R.id.content, fragment).commit(); } }
private void launchCameraIntent() { // TODO - Create a new intent to launch the MediaStore, Image capture function // Hint: use standard Intent from MediaStore class // See: http://developer.android.com/reference/android/provider/MediaStore.html Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); // TODO - Set the imagePath for this image file using the pre-made function // getOutputMediaFile to create a new filename for this specific image; fragment.imagePath = getOutputMediaFileUri(MEDIA_TYPE_IMAGE); // TODO - Add the filename to the Intent as an extra. Use the Intent-extra name // from the MediaStore class, EXTRA_OUTPUT cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, fragment.imagePath); // TODO - Start a new activity for result, using the new intent and the request // code CAMERA_PIC_REQUEST startActivityForResult(cameraIntent, CAMERA_PIC_REQUEST); }
private void launchVideoCameraIntent() { // TODO - Create a new intent to launch the MediaStore, Image capture function // Hint: use standard Intent from MediaStore class // See: http://developer.android.com/reference/android/provider/MediaStore.html Intent videoIntent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE); // TODO - Set the fileUri for this video file using the pre-made function // getOutputMediaFile to create a new filename for this specific video; fragment.fileUri = getOutputMediaFileUri(MEDIA_TYPE_VIDEO); // TODO - Add the filename to the Intent as an extra. Use the Intent-extra name // from the MediaStore class, EXTRA_OUTPUT videoIntent.putExtra(MediaStore.EXTRA_OUTPUT, fragment.fileUri); // TODO - Specify as an extra that the video quality should be HIGH. Use the // Intent-extra name, EXTRA_VIDEO_QUALITY, from the MediaStore class // set the video image quality to high videoIntent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 1); // TODO - Start a new activity for result, using the new intent and the request // code CAMERA_VIDEO_REQUEST startActivityForResult(videoIntent, CAMERA_VIDEO_REQUEST); }
private void makeUseOfNewLocation(Location loc) { fragment.setLocation(loc); }