- 私は2日間グーグルで検索しましたが、それでもこのメッセージが表示されます。nexus 7でデバッグキーを使用してデバッグします。
- どこが悪いのかわからない。私は正しいキーを持っています、正しいAPIアクセスを開きます
- しかし、タブレットの Google マップはまだ空白です。
マップフラグメント:
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.map_fragment,container, false); container.removeAllViews(); map = ((SupportMapFragment)getActivity() .getSupportFragmentManager() .findFragmentById(R.id.map)) .getMap(); map.setMyLocationEnabled(true); map.setMapType(GoogleMap.MAP_TYPE_NORMAL);mMapFragment = SupportMapFragment.newInstance(); FragmentTransaction fragmentTransaction =
getChildFragmentManager().beginTransaction();
fragmentTransaction.add(R.id.map,mMapFragment);
fragmentTransaction.commit(); rootView を返します。}
マニフェスト:
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="16" /> <!-- Google Map --> <permission android:name="com.jertt.xxx.permission.MAPS_RECEIVE" android:protectionLevel="signature"/> <uses-permission android:name="com.jertt.yummymap.permission.MAPS_RECEIVE"/>
<!-- end --> <uses-feature android:glEsVersion="0x00020000" android:required="true" /> <!-- end --> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/> <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name="com.jertt.yummymap.MainActivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <!-- Google Map API Key --> <meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="AIzaSyB54eZnUp8Sw*****" /> <!-- end --> </application>
map_fragment.xml
<fragment android:id="@+id/map" android:layout_width="match_parent" android:layout_height="match_parent" class="com.google.android.gms.maps.SupportMapFragment" />