Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
abook_check
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abook_android
abook_check
Commits
56af714a
Commit
56af714a
authored
Dec 10, 2025
by
Kang Donghun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#69733 abookcheck android.permission.READ_MEDIA_VIDEO、android.permission.READ_MEDIA_IMAGES権限除対応
parent
f422b82c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
12 deletions
+61
-12
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVActivity.java
+61
-12
No files found.
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVActivity.java
View file @
56af714a
...
...
@@ -17,6 +17,7 @@ import android.graphics.PixelFormat;
import
android.graphics.drawable.Drawable
;
import
android.net.Uri
;
import
android.os.Bundle
;
import
android.os.Environment
;
import
android.os.Handler
;
import
android.provider.MediaStore
;
import
android.provider.Settings
;
...
...
@@ -35,6 +36,10 @@ import android.view.WindowManager;
import
android.widget.EditText
;
import
android.widget.TextView
;
import
androidx.core.content.FileProvider
;
import
androidx.multidex.BuildConfig
;
import
java.io.File
;
import
java.lang.reflect.Constructor
;
import
java.lang.reflect.InvocationTargetException
;
import
java.lang.reflect.Method
;
...
...
@@ -941,40 +946,84 @@ public abstract class ABVActivity extends Activity {
private
void
showCameraOrAlbumSelectView
(
int
requestCode
,
String
title
,
String
type
,
boolean
cameraFlg
)
{
if
(
type
.
toLowerCase
().
equals
(
ABookKeys
.
IMAGE
))
{
Intent
galleryIntent
=
new
Intent
(
Intent
.
ACTION_PICK
,
MediaStore
.
Images
.
Media
.
EXTERNAL_CONTENT_URI
);
Intent
galleryIntent
=
new
Intent
(
MediaStore
.
ACTION_PICK_IMAGES
);
galleryIntent
.
setType
(
"image/*"
);
Intent
chooser
=
new
Intent
(
Intent
.
ACTION_CHOOSER
);
chooser
.
putExtra
(
Intent
.
EXTRA_INTENT
,
galleryIntent
);
chooser
.
putExtra
(
Intent
.
EXTRA_TITLE
,
title
);
if
(
cameraFlg
)
{
Intent
cameraIntent
=
new
Intent
(
MediaStore
.
ACTION_IMAGE_CAPTURE
);
ContentValues
values
=
new
ContentValues
();
values
.
put
(
MediaStore
.
MediaColumns
.
MIME_TYPE
,
"image/jpeg"
);
values
.
put
(
MediaStore
.
MediaColumns
.
DISPLAY_NAME
,
"camera_"
+
System
.
currentTimeMillis
()
+
".jpg"
);
values
.
put
(
MediaStore
.
MediaColumns
.
RELATIVE_PATH
,
"Pictures/AbookCheck"
);
// 폴더명(없으면 생성됨)
ContentValues
values
=
new
ContentValues
();
values
.
put
(
MediaStore
.
MediaColumns
.
TITLE
,
"New Picture"
);
values
.
put
(
MediaStore
.
Images
.
ImageColumns
.
DESCRIPTION
,
"From your Camera"
);
imageUri
=
getContentResolver
().
insert
(
MediaStore
.
Images
.
Media
.
EXTERNAL_CONTENT_URI
,
values
);
imageUri
=
getContentResolver
().
insert
(
MediaStore
.
Images
.
Media
.
EXTERNAL_CONTENT_URI
,
values
);
Intent
cameraIntent
=
new
Intent
(
MediaStore
.
ACTION_IMAGE_CAPTURE
);
cameraIntent
.
putExtra
(
MediaStore
.
EXTRA_OUTPUT
,
imageUri
);
cameraIntent
.
addFlags
(
Intent
.
FLAG_GRANT_WRITE_URI_PERMISSION
);
cameraIntent
.
addFlags
(
Intent
.
FLAG_GRANT_READ_URI_PERMISSION
);
chooser
.
putExtra
(
Intent
.
EXTRA_INITIAL_INTENTS
,
new
Intent
[]{
cameraIntent
});
Intent
[]
intentArray
=
new
Intent
[]{
cameraIntent
};
chooser
.
putExtra
(
Intent
.
EXTRA_INITIAL_INTENTS
,
intentArray
);
}
startActivityForResult
(
chooser
,
requestCode
);
// 여러 개 선택 가능하게 하고 싶으면 추가
// intent.putExtra(MediaStore.EXTRA_PICK_IMAGES_MAX, 1);
// Intent galleryIntent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
// galleryIntent.setType("image/*");
// Intent chooser = new Intent(Intent.ACTION_CHOOSER);
// chooser.putExtra(Intent.EXTRA_INTENT, galleryIntent);
// chooser.putExtra(Intent.EXTRA_TITLE, title);
// if (cameraFlg) {
//
// Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
//
// ContentValues values = new ContentValues();
// values.put(MediaStore.MediaColumns.TITLE, "New Picture");
// values.put(MediaStore.Images.ImageColumns.DESCRIPTION, "From your Camera");
// imageUri = getContentResolver().insert(
// MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);
// cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, imageUri);
//
// Intent[] intentArray = new Intent[]{cameraIntent};
// chooser.putExtra(Intent.EXTRA_INITIAL_INTENTS, intentArray);
// }
//
// startActivityForResult(chooser, requestCode);
}
else
if
(
type
.
toLowerCase
().
equals
(
ABookKeys
.
VIDEO
))
{
Intent
galleryIntent
=
new
Intent
(
Intent
.
ACTION_PICK
,
MediaStore
.
Video
.
Media
.
EXTERNAL_CONTENT_URI
);
galleryIntent
.
setType
(
"video/*"
);
Intent
galleryIntent
=
new
Intent
(
MediaStore
.
ACTION_PICK_IMAGES
);
galleryIntent
.
setType
(
"video/*"
);
// Video 선택만 허용
Intent
chooser
=
new
Intent
(
Intent
.
ACTION_CHOOSER
);
chooser
.
putExtra
(
Intent
.
EXTRA_INTENT
,
galleryIntent
);
chooser
.
putExtra
(
Intent
.
EXTRA_TITLE
,
title
);
if
(
cameraFlg
)
{
Intent
cameraIntent
=
new
Intent
(
MediaStore
.
ACTION_VIDEO_CAPTURE
);
Intent
[]
intentArray
=
new
Intent
[]{
cameraIntent
};
chooser
.
putExtra
(
Intent
.
EXTRA_INITIAL_INTENTS
,
intentArray
);
}
startActivityForResult
(
chooser
,
requestCode
);
// Intent galleryIntent = new Intent(Intent.ACTION_PICK, MediaStore.Video.Media.EXTERNAL_CONTENT_URI);
// galleryIntent.setType("video/*");
// Intent chooser = new Intent(Intent.ACTION_CHOOSER);
// chooser.putExtra(Intent.EXTRA_INTENT, galleryIntent);
// chooser.putExtra(Intent.EXTRA_TITLE, title);
// if (cameraFlg) {
// Intent cameraIntent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
// Intent[] intentArray = new Intent[]{cameraIntent};
// chooser.putExtra(Intent.EXTRA_INITIAL_INTENTS, intentArray);
// }
// startActivityForResult(chooser, requestCode);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment