質問編集履歴

2

style\.xmlを追加した

2017/07/19 00:48

投稿

atatatatata
atatatatata

スコア77

test CHANGED
File without changes
test CHANGED
@@ -3,6 +3,60 @@
3
3
  java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity
4
4
 
5
5
  どうすればいいのでしょうか?
6
+
7
+ ```xml
8
+
9
+ <?xml version="1.0" encoding="utf-8"?>
10
+
11
+ <!-- Copyright (C) 2016 The Android Open Source Project
12
+
13
+
14
+
15
+ Licensed under the Apache License, Version 2.0 (the "License");
16
+
17
+ you may not use this file except in compliance with the License.
18
+
19
+ You may obtain a copy of the License at
20
+
21
+
22
+
23
+ http://www.apache.org/licenses/LICENSE-2.0
24
+
25
+
26
+
27
+ Unless required by applicable law or agreed to in writing, software
28
+
29
+ distributed under the License is distributed on an "AS IS" BASIS,
30
+
31
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
32
+
33
+ See the License for the specific language governing permissions and
34
+
35
+ limitations under the License.
36
+
37
+ -->
38
+
39
+
40
+
41
+ <resources xmlns:android="http://schemas.android.com/apk/res/android">
42
+
43
+
44
+
45
+ <style name="PlayerTheme" parent="android:Theme.Holo">
46
+
47
+ <item name="android:windowNoTitle">true</item>
48
+
49
+ <item name="android:windowBackground">@android:color/black</item>
50
+
51
+ </style>
52
+
53
+
54
+
55
+ </resources>
56
+
57
+
58
+
59
+ ```
6
60
 
7
61
  ```xml
8
62
 

1

コードの追加

2017/07/19 00:48

投稿

atatatatata
atatatatata

スコア77

test CHANGED
File without changes
test CHANGED
@@ -4,15 +4,69 @@
4
4
 
5
5
  どうすればいいのでしょうか?
6
6
 
7
+ ```xml
8
+
9
+ <?xml version="1.0" encoding="utf-8"?>
10
+
11
+ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
12
+
13
+ xmlns:app="http://schemas.android.com/apk/res-auto"
14
+
15
+ xmlns:tools="http://schemas.android.com/tools"
16
+
17
+ android:layout_width="match_parent"
18
+
19
+ android:layout_height="match_parent"
20
+
21
+ tools:context="com.google.android.exoplayer2.demo.CheckGpsActivity">
22
+
23
+
24
+
25
+ </LinearLayout>
26
+
27
+
28
+
29
+ ```
30
+
31
+
32
+
7
33
  ```java
8
34
 
35
+ public class CheckGpsActivity extends AppCompatActivity {
36
+
37
+
38
+
39
+ private final int REQUEST_PERMISSION = 1000;
40
+
41
+
42
+
9
- @Override
43
+ @Override
10
44
 
11
45
  protected void onCreate(Bundle savedInstanceState) {
12
46
 
13
47
  super.onCreate(savedInstanceState);
14
48
 
15
49
  setContentView(R.layout.activity_checkgps);
50
+
51
+
52
+
53
+ // Android 6, API 23以上でパーミッシンの確認
54
+
55
+ if(Build.VERSION.SDK_INT >= 23){
56
+
57
+ checkPermission();
58
+
59
+ }
60
+
61
+ else{
62
+
63
+ locationActivity();
64
+
65
+ }
66
+
67
+ }
68
+
69
+
16
70
 
17
71
  ```
18
72