Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 11-26 19:16:34.100: E/AndroidRuntime(17871): java.lang.IllegalArgumentException: Textures with dimensions8192x4096 are larger than the maximum supported size 4096x4096
- public void onMapClick(LatLng point) {
- Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
- File photo = new File(Environment.getExternalStorageDirectory(), "Pic.jpg");
- intent.putExtra(MediaStore.EXTRA_OUTPUT,
- Uri.fromFile(photo));
- imageUri = Uri.fromFile(photo);
- startActivityForResult(intent, TAKE_PICTURE);
- }
- public void onActivityResult(int requestCode, int resultCode, Intent data) {
- super.onActivityResult(requestCode, resultCode, data);
- switch (requestCode) {
- case TAKE_PICTURE:
- if (resultCode == Activity.RESULT_OK) {
- Uri selectedImage = imageUri;
- getContentResolver().notifyChange(selectedImage, null);
- ContentResolver cr = getContentResolver();
- Bitmap bitmap;
- try {
- bitmap = android.provider.MediaStore.Images.Media
- .getBitmap(cr, selectedImage);
- BitmapFactory.Options options = new BitmapFactory.Options();
- options.inPreferredConfig = Bitmap.Config.ARGB_8888;
- options.inSampleSize = 1;
- options.inDensity = DisplayMetrics.DENSITY_MEDIUM;
- options.inTargetDensity = getApplication().getResources().getDisplayMetrics().densityDpi;
- options.inScaled = true;
- options.inJustDecodeBounds = false;
- MarkerOptions markerOptions = new MarkerOptions()
- .position(point)
- .icon(BitmapDescriptorFactory
- .fromBitmap(bitmap));
- googleMap.addMarker(markerOptions);
- Toast.makeText(this, selectedImage.toString(),
- Toast.LENGTH_LONG).show();
- } catch (Exception e) {
- Toast.makeText(this, "Failed to load", Toast.LENGTH_SHORT)
- .show();
- Log.e("Camera", e.toString());
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement