質問編集履歴

3

書式の改善

2024/01/04 16:06

投稿

lychee12
lychee12

スコア3

test CHANGED
File without changes
test CHANGED
@@ -8,15 +8,10 @@
8
8
  Compile Sdk Version 34
9
9
 
10
10
  ### 発生している問題・エラーメッセージ
11
- 共有した後にIntentにデータを入れる動作が行われない
11
+ 共有した後にIntentにデータを入れる動作が行われない状況です。
12
12
 
13
13
  ```
14
- d.receivingtest com.android.receivingtest I Late-enabling -Xcheck:jni
15
- d.receivingtest com.android.receivingtest I Using CollectorTypeCC GC.
16
- d.receivingtest com.android.receivingtest W Unexpected CPU variant for x86: x86_64.
17
- Known variants: atom, sandybridge, silvermont, goldmont, goldmont-plus, tremont, kabylake, default
18
- d.receivingtest com.android.receivingtest W DexFile /data/data/com.android.receivingtest/code_cache/.studio/instruments-7b9ed48c.jar is in boot class path but is not in a known location
19
- re-initialized> com.android.receivingtest W type=1400 audit(0.0:401): avc: granted { execute } for path="/data/data/com.android.receivingtest/code_cache/startup_agents/08bc8eac-agent.so" dev="dm-40" ino=336103 scontext=u:r:untrusted_app:s0:c192,c256,c512,c768 tcontext=u:object_r:app_data_file:s0:c192,c256,c512,c768 tclass=file app=com.android.receivingtest
14
+
20
15
  d.receivingtest com.android.receivingtest W Redefining intrinsic method java.lang.Thread java.lang.Thread.currentThread(). This may cause the unexpected use of the original definition of java.lang.Thread java.lang.Thread.currentThread()in methods that have already been compiled.
21
16
  d.receivingtest com.android.receivingtest W Redefining intrinsic method boolean java.lang.Thread.interrupted(). This may cause the unexpected use of the original definition of boolean java.lang.Thread.interrupted()in methods that have already been compiled.
22
17
  Compatibil...geReporter com.android.receivingtest D Compat change id reported: 171979766; UID 10192; state: ENABLED
@@ -47,6 +42,20 @@
47
42
  ProfileInstaller com.android.receivingtest D Installing profile for com.android.receivingtest
48
43
  //chromeから共有
49
44
  OpenGLRenderer com.android.receivingtest E Unable to match the desired swap behavior.
45
+ ```
46
+ ```
47
+ emulatorなどを再起動してなぜか一度だけうまくいったログです
48
+
49
+ //chromeから共有
50
+ AssistStructure com.android.receivingtest I Flattened final assist data: 1128 bytes, containing 1 windows, 11 views
51
+ EGL_emulation com.android.receivingtest D app_time_stats: avg=2194.26ms min=0.84ms max=32670.24ms count=17
52
+ intent com.android.receivingtest D intent:Intent { act=android.intent.action.SEND typ=text/plain flg=0x1b080000 cmp=com.android.receivingtest/.MainActivity clip={text/plain {T(184)}} (has extras) }
53
+ sharedText com.android.receivingtest D sharedText:"場合"
54
+ https://news.yahoo.co.jp/articles/3d8cce9fbde19cd7d5bedbfec7b87e90d0e7a865#:~:text=%E3%82%92%E4%BD%BF%E3%81%86-,%E5%A0%B4%E5%90%88,-%E3%81%AF1%E3%83%9D%E3%82%A4%E3%83%B3%E3%83%88
55
+ OpenGLRenderer com.android.receivingtest W Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
56
+ OpenGLRenderer com.android.receivingtest W Failed to initialize 101010-2 format, error = EGL_SUCCESS
57
+ OpenGLRenderer com.android.receivingtest E Unable to match the desired swap behavior.
58
+ AutofillManager com.android.receivingtest D Fill dialog is enabled:false, hints=[]
50
59
  ```
51
60
 
52
61
  ### 該当のソースコード

2

書式の改善

2024/01/04 15:53

投稿

lychee12
lychee12

スコア3

test CHANGED
File without changes
test CHANGED
@@ -8,6 +8,7 @@
8
8
  Compile Sdk Version 34
9
9
 
10
10
  ### 発生している問題・エラーメッセージ
11
+ 共有した後にIntentにデータを入れる動作が行われない
11
12
 
12
13
  ```
13
14
  d.receivingtest com.android.receivingtest I Late-enabling -Xcheck:jni

1

間違えて入力途中で投稿してしまったので不足分を加えた

2024/01/04 15:45

投稿

lychee12
lychee12

スコア3

test CHANGED
File without changes
test CHANGED
@@ -2,69 +2,140 @@
2
2
 
3
3
  Chromeからテキストを共有して自作のアプリに表示させたい
4
4
  ### 前提
5
-
5
+ Android Studio 2022.3.1 patch 4
6
+ Gradle Plugin Version 8.1.4
7
+ Gradle Version 8.0
6
- ここに質問の内容を詳しく書いてください。
8
+ Compile Sdk Version 34
7
- (例)
8
-
9
-
10
9
 
11
10
  ### 発生している問題・エラーメッセージ
12
11
 
13
12
  ```
14
- エラーメッセージ
13
+ d.receivingtest com.android.receivingtest I Late-enabling -Xcheck:jni
14
+ d.receivingtest com.android.receivingtest I Using CollectorTypeCC GC.
15
+ d.receivingtest com.android.receivingtest W Unexpected CPU variant for x86: x86_64.
16
+ Known variants: atom, sandybridge, silvermont, goldmont, goldmont-plus, tremont, kabylake, default
17
+ d.receivingtest com.android.receivingtest W DexFile /data/data/com.android.receivingtest/code_cache/.studio/instruments-7b9ed48c.jar is in boot class path but is not in a known location
18
+ re-initialized> com.android.receivingtest W type=1400 audit(0.0:401): avc: granted { execute } for path="/data/data/com.android.receivingtest/code_cache/startup_agents/08bc8eac-agent.so" dev="dm-40" ino=336103 scontext=u:r:untrusted_app:s0:c192,c256,c512,c768 tcontext=u:object_r:app_data_file:s0:c192,c256,c512,c768 tclass=file app=com.android.receivingtest
19
+ d.receivingtest com.android.receivingtest W Redefining intrinsic method java.lang.Thread java.lang.Thread.currentThread(). This may cause the unexpected use of the original definition of java.lang.Thread java.lang.Thread.currentThread()in methods that have already been compiled.
20
+ d.receivingtest com.android.receivingtest W Redefining intrinsic method boolean java.lang.Thread.interrupted(). This may cause the unexpected use of the original definition of boolean java.lang.Thread.interrupted()in methods that have already been compiled.
21
+ Compatibil...geReporter com.android.receivingtest D Compat change id reported: 171979766; UID 10192; state: ENABLED
22
+ Compatibil...geReporter com.android.receivingtest D Compat change id reported: 242716250; UID 10192; state: ENABLED
23
+ ziparchive com.android.receivingtest W Unable to open '/data/app/~~W27E5yHhUYjgtf_pndsoTg==/com.android.receivingtest-6r0cKRxikUna-MM4eIXxRQ==/base.dm': No such file or directory
24
+ ziparchive com.android.receivingtest W Unable to open '/data/app/~~W27E5yHhUYjgtf_pndsoTg==/com.android.receivingtest-6r0cKRxikUna-MM4eIXxRQ==/base.dm': No such file or directory
25
+ nativeloader com.android.receivingtest D Configuring clns-6 for other apk /data/app/~~W27E5yHhUYjgtf_pndsoTg==/com.android.receivingtest-6r0cKRxikUna-MM4eIXxRQ==/base.apk. target_sdk_version=34, uses_libraries=, library_path=/data/app/~~W27E5yHhUYjgtf_pndsoTg==/com.android.receivingtest-6r0cKRxikUna-MM4eIXxRQ==/lib/x86_64, permitted_path=/data:/mnt/expand:/data/user/0/com.android.receivingtest
26
+ GraphicsEnvironment com.android.receivingtest V Currently set values for:
27
+ GraphicsEnvironment com.android.receivingtest V angle_gl_driver_selection_pkgs=[]
28
+ GraphicsEnvironment com.android.receivingtest V angle_gl_driver_selection_values=[]
29
+ GraphicsEnvironment com.android.receivingtest V ANGLE GameManagerService for com.android.receivingtest: false
30
+ GraphicsEnvironment com.android.receivingtest V com.android.receivingtest is not listed in per-application setting
31
+ GraphicsEnvironment com.android.receivingtest V Neither updatable production driver nor prerelease driver is supported.
32
+ libEGL com.android.receivingtest D loaded /vendor/lib64/egl/libEGL_emulation.so
33
+ libEGL com.android.receivingtest D loaded /vendor/lib64/egl/libGLESv1_CM_emulation.so
34
+ libEGL com.android.receivingtest D loaded /vendor/lib64/egl/libGLESv2_emulation.so
35
+ AppCompatDelegate com.android.receivingtest D Checking for metadata for AppLocalesMetadataHolderService : Service not found
36
+ d.receivingtest com.android.receivingtest W Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (unsupported, reflection, allowed)
37
+ d.receivingtest com.android.receivingtest W Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (unsupported, reflection, allowed)
38
+ Compatibil...geReporter com.android.receivingtest D Compat change id reported: 210923482; UID 10192; state: ENABLED
39
+ intent com.android.receivingtest D intent:Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.android.receivingtest/.MainActivity }
40
+ Compatibil...geReporter com.android.receivingtest D Compat change id reported: 237531167; UID 10192; state: DISABLED
41
+ OpenGLRenderer com.android.receivingtest W Unknown dataspace 0
42
+ OpenGLRenderer com.android.receivingtest W Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
43
+ OpenGLRenderer com.android.receivingtest W Failed to initialize 101010-2 format, error = EGL_SUCCESS
44
+ Gralloc4 com.android.receivingtest I mapper 4.x is not supported
45
+ OpenGLRenderer com.android.receivingtest E Unable to match the desired swap behavior.
46
+ ProfileInstaller com.android.receivingtest D Installing profile for com.android.receivingtest
47
+ //chromeから共有
48
+ OpenGLRenderer com.android.receivingtest E Unable to match the desired swap behavior.
15
49
  ```
16
- ---------------------------- PROCESS STARTED (14185) for package com.android.receivingtest ----------------------------
17
- --------- beginning of main
18
- --------- beginning of system
19
- --------- beginning of kernel
20
- 2024-01-04 22:08:30.699 14185-14185 d.receivingtest com.android.receivingtest I Late-enabling -Xcheck:jni
21
- 2024-01-04 22:08:30.798 14185-14185 d.receivingtest com.android.receivingtest I Using CollectorTypeCC GC.
22
- 2024-01-04 22:08:30.805 14185-14185 d.receivingtest com.android.receivingtest W Unexpected CPU variant for x86: x86_64.
23
- Known variants: atom, sandybridge, silvermont, goldmont, goldmont-plus, tremont, kabylake, default
24
- 2024-01-04 22:08:31.016 14185-14185 d.receivingtest com.android.receivingtest W DexFile /data/data/com.android.receivingtest/code_cache/.studio/instruments-7b9ed48c.jar is in boot class path but is not in a known location
25
- 2024-01-04 22:08:30.993 14185-14185 re-initialized> com.android.receivingtest W type=1400 audit(0.0:401): avc: granted { execute } for path="/data/data/com.android.receivingtest/code_cache/startup_agents/08bc8eac-agent.so" dev="dm-40" ino=336103 scontext=u:r:untrusted_app:s0:c192,c256,c512,c768 tcontext=u:object_r:app_data_file:s0:c192,c256,c512,c768 tclass=file app=com.android.receivingtest
26
- 2024-01-04 22:08:31.062 14185-14185 d.receivingtest com.android.receivingtest W Redefining intrinsic method java.lang.Thread java.lang.Thread.currentThread(). This may cause the unexpected use of the original definition of java.lang.Thread java.lang.Thread.currentThread()in methods that have already been compiled.
27
- 2024-01-04 22:08:31.062 14185-14185 d.receivingtest com.android.receivingtest W Redefining intrinsic method boolean java.lang.Thread.interrupted(). This may cause the unexpected use of the original definition of boolean java.lang.Thread.interrupted()in methods that have already been compiled.
28
- 2024-01-04 22:08:31.065 14185-14185 Compatibil...geReporter com.android.receivingtest D Compat change id reported: 171979766; UID 10192; state: ENABLED
29
- 2024-01-04 22:08:31.066 14185-14185 Compatibil...geReporter com.android.receivingtest D Compat change id reported: 242716250; UID 10192; state: ENABLED
30
- 2024-01-04 22:08:31.125 14185-14185 ziparchive com.android.receivingtest W Unable to open '/data/app/~~W27E5yHhUYjgtf_pndsoTg==/com.android.receivingtest-6r0cKRxikUna-MM4eIXxRQ==/base.dm': No such file or directory
31
- 2024-01-04 22:08:31.126 14185-14185 ziparchive com.android.receivingtest W Unable to open '/data/app/~~W27E5yHhUYjgtf_pndsoTg==/com.android.receivingtest-6r0cKRxikUna-MM4eIXxRQ==/base.dm': No such file or directory
32
- 2024-01-04 22:08:31.377 14185-14185 nativeloader com.android.receivingtest D Configuring clns-6 for other apk /data/app/~~W27E5yHhUYjgtf_pndsoTg==/com.android.receivingtest-6r0cKRxikUna-MM4eIXxRQ==/base.apk. target_sdk_version=34, uses_libraries=, library_path=/data/app/~~W27E5yHhUYjgtf_pndsoTg==/com.android.receivingtest-6r0cKRxikUna-MM4eIXxRQ==/lib/x86_64, permitted_path=/data:/mnt/expand:/data/user/0/com.android.receivingtest
33
- 2024-01-04 22:08:31.399 14185-14185 GraphicsEnvironment com.android.receivingtest V Currently set values for:
34
- 2024-01-04 22:08:31.399 14185-14185 GraphicsEnvironment com.android.receivingtest V angle_gl_driver_selection_pkgs=[]
35
- 2024-01-04 22:08:31.400 14185-14185 GraphicsEnvironment com.android.receivingtest V angle_gl_driver_selection_values=[]
36
- 2024-01-04 22:08:31.400 14185-14185 GraphicsEnvironment com.android.receivingtest V ANGLE GameManagerService for com.android.receivingtest: false
37
- 2024-01-04 22:08:31.400 14185-14185 GraphicsEnvironment com.android.receivingtest V com.android.receivingtest is not listed in per-application setting
38
- 2024-01-04 22:08:31.401 14185-14185 GraphicsEnvironment com.android.receivingtest V Neither updatable production driver nor prerelease driver is supported.
39
- 2024-01-04 22:08:31.480 14185-14208 libEGL com.android.receivingtest D loaded /vendor/lib64/egl/libEGL_emulation.so
40
- 2024-01-04 22:08:31.487 14185-14208 libEGL com.android.receivingtest D loaded /vendor/lib64/egl/libGLESv1_CM_emulation.so
41
- 2024-01-04 22:08:31.494 14185-14208 libEGL com.android.receivingtest D loaded /vendor/lib64/egl/libGLESv2_emulation.so
42
- 2024-01-04 22:08:31.526 14185-14185 AppCompatDelegate com.android.receivingtest D Checking for metadata for AppLocalesMetadataHolderService : Service not found
43
- 2024-01-04 22:08:31.709 14185-14185 d.receivingtest com.android.receivingtest W Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (unsupported, reflection, allowed)
44
- 2024-01-04 22:08:31.709 14185-14185 d.receivingtest com.android.receivingtest W Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (unsupported, reflection, allowed)
45
- 2024-01-04 22:08:31.779 14185-14185 Compatibil...geReporter com.android.receivingtest D Compat change id reported: 210923482; UID 10192; state: ENABLED
46
- 2024-01-04 22:08:31.796 14185-14185 intent com.android.receivingtest D intent:Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.android.receivingtest/.MainActivity }
47
- 2024-01-04 22:08:31.851 14185-14185 Compatibil...geReporter com.android.receivingtest D Compat change id reported: 237531167; UID 10192; state: DISABLED
48
- 2024-01-04 22:08:31.853 14185-14185 OpenGLRenderer com.android.receivingtest W Unknown dataspace 0
49
- 2024-01-04 22:08:31.902 14185-14206 OpenGLRenderer com.android.receivingtest W Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
50
- 2024-01-04 22:08:31.902 14185-14206 OpenGLRenderer com.android.receivingtest W Failed to initialize 101010-2 format, error = EGL_SUCCESS
51
- 2024-01-04 22:08:31.957 14185-14206 Gralloc4 com.android.receivingtest I mapper 4.x is not supported
52
- 2024-01-04 22:08:31.967 14185-14206 OpenGLRenderer com.android.receivingtest E Unable to match the desired swap behavior.
53
- 2024-01-04 22:08:37.307 14185-14220 ProfileInstaller com.android.receivingtest D Installing profile for com.android.receivingtest
54
- //chromeから共有
55
- 2024-01-04 22:09:08.464 14185-14206 OpenGLRenderer com.android.receivingtest E Unable to match the desired swap behavior.
56
50
 
57
51
  ### 該当のソースコード
58
52
 
53
+ ```AndroidManifest.xml
54
+ <?xml version="1.0" encoding="utf-8"?>
55
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
56
+ xmlns:tools="http://schemas.android.com/tools">
57
+ <application
58
+ android:allowBackup="true"
59
+ android:dataExtractionRules="@xml/data_extraction_rules"
60
+ android:fullBackupContent="@xml/backup_rules"
61
+ android:icon="@mipmap/ic_launcher"
62
+ android:label="@string/app_name"
63
+ android:roundIcon="@mipmap/ic_launcher_round"
64
+ android:supportsRtl="true"
65
+ android:theme="@style/Theme.ReceivingTest"
66
+ tools:targetApi="31">
59
- ```ここに言語名を入力
67
+ <activity
68
+ android:name=".MainActivity"
69
+ android:exported="true">
70
+ <intent-filter>
71
+ <action android:name="android.intent.action.MAIN" />
72
+
73
+ <category android:name="android.intent.category.LAUNCHER" />
74
+ </intent-filter>
75
+ <intent-filter>
76
+ <action android:name="android.intent.action.SEND" />
77
+ <category android:name="android.intent.category.DEFAULT" />
78
+ <data android:mimeType="text/plain" />
79
+ </intent-filter>
80
+ </activity>
81
+ </application>
82
+
83
+ </manifest>
84
+ ```
85
+ ```MainActivity.java
86
+ public class MainActivity extends AppCompatActivity {
87
+
60
- ソースコード
88
+ @Override
89
+ protected void onCreate(Bundle savedInstanceState) {
90
+ super.onCreate(savedInstanceState);
91
+ setContentView(R.layout.activity_main);
92
+
93
+ Intent intent = getIntent();
94
+ String action = intent.getAction();
95
+ String type = intent.getType();
96
+
97
+ Log.d("intent","intent:"+intent);
98
+
99
+ if (Intent.ACTION_SEND.equals(action) && type != null) {
100
+ if ("text/plain".equals(type)) {
101
+ handleSendText(intent);
102
+ }
103
+ }
104
+ }
105
+
106
+ void handleSendText(Intent intent) {
107
+ String sharedText = intent.getStringExtra(Intent.EXTRA_TEXT);
108
+ Log.d("sharedText", "sharedText:"+sharedText);
109
+ if (sharedText != null) {
110
+ TextView sharedBox = findViewById(R.id.TextView);
111
+ sharedBox.setText(sharedText);
112
+ }
113
+ }
114
+ }
115
+ ```
116
+ ```activity_main.xml
117
+ <?xml version="1.0" encoding="utf-8"?>
118
+ <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
119
+ xmlns:app="http://schemas.android.com/apk/res-auto"
120
+ xmlns:tools="http://schemas.android.com/tools"
121
+ android:layout_width="match_parent"
122
+ android:layout_height="match_parent"
123
+ tools:context=".MainActivity">
124
+
125
+ <TextView
126
+ android:layout_width="wrap_content"
127
+ android:layout_height="wrap_content"
128
+ android:id="@+id/TextView"
129
+ app:layout_constraintBottom_toBottomOf="parent"
130
+ app:layout_constraintEnd_toEndOf="parent"
131
+ app:layout_constraintStart_toStartOf="parent"
132
+ app:layout_constraintTop_toTopOf="parent" />
133
+
134
+ </androidx.constraintlayout.widget.ConstraintLayout>
61
135
  ```
62
136
 
63
- ### 試したこと
64
-
65
- ここに問題に対して試したことを記載してください。
66
137
 
67
138
  ### 補足情報(FW/ツールのバージョンなど)
139
+ [参考文献(公式ドキュメント)](https://developer.android.com/training/sharing/receive?hl=ja)
68
140
 
69
- ここにより詳細な情報を記載してください。
70
141