
--- .idea/deploymentTargetDropDown.xml
+++ .idea/deploymentTargetDropDown.xml
... | ... | @@ -3,7 +3,20 @@ |
3 | 3 |
<component name="deploymentTargetDropDown"> |
4 | 4 |
<value> |
5 | 5 |
<entry key="app"> |
6 |
- <State /> |
|
6 |
+ <State> |
|
7 |
+ <runningDeviceTargetSelectedWithDropDown> |
|
8 |
+ <Target> |
|
9 |
+ <type value="RUNNING_DEVICE_TARGET" /> |
|
10 |
+ <deviceKey> |
|
11 |
+ <Key> |
|
12 |
+ <type value="SERIAL_NUMBER" /> |
|
13 |
+ <value value="RFCMA00RHQD" /> |
|
14 |
+ </Key> |
|
15 |
+ </deviceKey> |
|
16 |
+ </Target> |
|
17 |
+ </runningDeviceTargetSelectedWithDropDown> |
|
18 |
+ <timeTargetWasSelectedWithDropDown value="2024-03-11T06:24:22.295141900Z" /> |
|
19 |
+ </State> |
|
7 | 20 |
</entry> |
8 | 21 |
</value> |
9 | 22 |
</component> |
--- app/src/main/AndroidManifest.xml
+++ app/src/main/AndroidManifest.xml
... | ... | @@ -36,6 +36,16 @@ |
36 | 36 |
<category android:name="android.intent.category.LAUNCHER" /> |
37 | 37 |
</intent-filter> |
38 | 38 |
</activity> |
39 |
+ <provider |
|
40 |
+ android:name="androidx.core.content.FileProvider" |
|
41 |
+ android:authorities="${applicationId}.provider" |
|
42 |
+ android:exported="false" |
|
43 |
+ android:grantUriPermissions="true"> |
|
44 |
+ <meta-data |
|
45 |
+ android:name="android.support.FILE_PROVIDER_PATHS" |
|
46 |
+ android:resource="@xml/file_paths" /> |
|
47 |
+ </provider> |
|
48 |
+ |
|
39 | 49 |
</application> |
40 | 50 |
|
41 | 51 |
</manifest>(파일 끝에 줄바꿈 문자 없음) |
--- app/src/main/java/co/kr/ajinpaper/salesTask/MainActivity.java
+++ app/src/main/java/co/kr/ajinpaper/salesTask/MainActivity.java
... | ... | @@ -9,10 +9,12 @@ |
9 | 9 |
import android.app.Activity; |
10 | 10 |
import android.content.ClipData; |
11 | 11 |
import android.content.Intent; |
12 |
+import android.content.SharedPreferences; |
|
12 | 13 |
import android.net.Uri; |
13 | 14 |
import android.os.Bundle; |
14 | 15 |
import android.os.Environment; |
15 | 16 |
import android.provider.MediaStore; |
17 |
+import android.util.Log; |
|
16 | 18 |
import android.webkit.ValueCallback; |
17 | 19 |
import android.webkit.WebChromeClient; |
18 | 20 |
import android.webkit.WebSettings; |
... | ... | @@ -35,10 +37,11 @@ |
35 | 37 |
setContentView(R.layout.activity_main); |
36 | 38 |
|
37 | 39 |
if (getIntent().getExtras() != null) { |
40 |
+ Log.d("WebView", "백에서 실행함"); |
|
38 | 41 |
String title = getIntent().getExtras().getString("title"); |
39 |
- if (title != null) { |
|
40 |
- // 'title' 데이터를 사용하는 로직, 예를 들어 TextView 설정 |
|
41 |
- } |
|
42 |
+ SharedPreferences sharedPreferences = getSharedPreferences("MyApp", MODE_PRIVATE); |
|
43 |
+ SharedPreferences.Editor editor = sharedPreferences.edit(); |
|
44 |
+ editor.putString("pushTitle", title).apply(); |
|
42 | 45 |
} |
43 | 46 |
|
44 | 47 |
WebView myWebView = (WebView) findViewById(R.id.webView); |
... | ... | @@ -67,11 +70,9 @@ |
67 | 70 |
Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); |
68 | 71 |
if (takePictureIntent.resolveActivity(getPackageManager()) != null) { |
69 | 72 |
File photoFile = null; |
70 |
- try { |
|
71 |
- photoFile = createImageFile(); |
|
73 |
+ photoFile = createImageFile(); |
|
74 |
+ if (mCapturedImageURI != null) { |
|
72 | 75 |
takePictureIntent.putExtra("PhotoPath", mCapturedImageURI.toString()); |
73 |
- } catch (IOException ex) { |
|
74 |
- ex.printStackTrace(); |
|
75 | 76 |
} |
76 | 77 |
|
77 | 78 |
if (photoFile != null) { |
... | ... | @@ -147,11 +148,18 @@ |
147 | 148 |
} |
148 | 149 |
); |
149 | 150 |
|
150 |
- private File createImageFile() throws IOException { |
|
151 |
- @SuppressLint("SimpleDateFormat") String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date()); |
|
152 |
- String imageFileName = "JPEG_" + timeStamp + "_"; |
|
153 |
- File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES); |
|
154 |
- return File.createTempFile(imageFileName, ".jpg", storageDir); |
|
151 |
+ private File createImageFile() { |
|
152 |
+ try { |
|
153 |
+ @SuppressLint("SimpleDateFormat") String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date()); |
|
154 |
+ String imageFileName = "JPEG_" + timeStamp + "_"; |
|
155 |
+ File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES); |
|
156 |
+ File imageFile = File.createTempFile(imageFileName, ".jpg", storageDir); |
|
157 |
+ mCapturedImageURI = Uri.fromFile(imageFile); |
|
158 |
+ return imageFile; |
|
159 |
+ } catch (IOException ex) { |
|
160 |
+ ex.printStackTrace(); |
|
161 |
+ return null; |
|
162 |
+ } |
|
155 | 163 |
} |
156 | 164 |
|
157 | 165 |
}(파일 끝에 줄바꿈 문자 없음) |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?