java - Android Google Map V2 - "unfortunately App has stopped" -
i'm trying display google map on android app when user click on button. when click button app stops.no error in code. believe i've done right 1-i got api key
2-i added google_play_services_lib.jar dependencies folder
3-added support tool
4-included permissions,my key manifest
5-added fragment xml layout fie map
please feel i've read , watched every tutorial there is...nothing worked!
my log:
03-10 20:27:10.057: i/process(17287): sending signal. pid: 17287 sig: 9 03-10 20:27:15.072: d/libegl(17688): loaded /vendor/lib/egl/libegl_adreno.so 03-10 20:27:15.072: d/libegl(17688): loaded /vendor/lib/egl/libglesv1_cm_adreno.so 03-10 20:27:15.082: d/libegl(17688): loaded /vendor/lib/egl/libglesv2_adreno.so 03-10 20:27:15.082: i/adreno-egl(17688): <qegldrvapi_eglinitialize:316>: egl 1.4 qualcomm build: (cl4169980) 03-10 20:27:15.082: i/adreno-egl(17688): opengl es shader compiler version: 17.01.10.spl 03-10 20:27:15.082: i/adreno-egl(17688): build date: 09/26/13 thu 03-10 20:27:15.082: i/adreno-egl(17688): local branch: 03-10 20:27:15.082: i/adreno-egl(17688): remote branch: 03-10 20:27:15.082: i/adreno-egl(17688): local patches: 03-10 20:27:15.082: i/adreno-egl(17688): reconstruct branch: 03-10 20:27:15.122: d/openglrenderer(17688): enabling debug mode 0 03-10 20:27:16.683: d/androidruntime(17688): shutting down vm 03-10 20:27:16.683: w/dalvikvm(17688): threadid=1: thread exiting uncaught exception (group=0x41931898) 03-10 20:27:16.693: e/androidruntime(17688): fatal exception: main 03-10 20:27:16.693: e/androidruntime(17688): java.lang.runtimeexception: unable start activity componentinfo{com.example.newandroid/com.example.newandroid.mymap}: android.view.inflateexception: binary xml file line #7: error inflating class fragment 03-10 20:27:16.693: e/androidruntime(17688): @ android.app.activitythread.performlaunchactivity(activitythread.java:2295) 03-10 20:27:16.693: e/androidruntime(17688): @ android.app.activitythread.handlelaunchactivity(activitythread.java:2349) 03-10 20:27:16.693: e/androidruntime(17688): @ android.app.activitythread.access$700(activitythread.java:159) my code mymap activity p
ackage com.example.newandroid; import android.os.bundle; //import android.app.activity; import android.support.v4.app.fragmentactivity; public class mymap extends fragmentactivity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_mymap); } } my layout
<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <fragment android:name="com.google.android.gms.maps.supportmapfragment" xmlns:map="http://schemas.android.com/apk/res-auto" android:id="@+id/map" android:layout_width="match_parent" android:layout_height="match_parent" /> </linearlayout> manifest
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.newandroid" android:versioncode="1" android:versionname="1.0" > <permission android:name="com.example.newandroid.permission.maps_receive" android:protectionlevel="signature" /> <uses-permission android:name="com.example.newandroid.permission.maps_receive" /> <uses-permission android:name="android.permission.internet" /> <uses-permission android:name="android.permission.write_external_storage" /> <uses-permission android:name="com.google.android.providers.gsf.permission.read_gservices" /> <uses-permission android:name="android.permission.access_coarse_location" /> <uses-permission android:name="android.permission.access_fine_location" /> <uses-sdk android:minsdkversion="8" android:targetsdkversion="17" /> <uses-feature android:glesversion="0x00020000" android:required="true"/> <application android:allowbackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/apptheme" > <activity android:name="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> <activity android:name="com.example.newandroid.mymap" android:label="@string/title_activity_mymap" android:parentactivityname="com.example.newandroid.mainactivity" > <meta-data android:name="android.support.parent_activity" android:value="com.example.newandroid.mainactivity" /> </activity> <meta-data android:name="com.google.android.maps.v2.api_key" android:value="aizasyaq44a-wwb4w6mujjqz1dmh-livyscbiyk"/> </application> </manifest> this mainactivity button ,when clicked should start mymap activity.this mainactivity code
import android.app.activity; import android.content.intent; import android.os.bundle; import android.view.view; public class mainactivity extends activity { @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); // todo auto-generated method stub } public void view_map(view view) { intent intent = new intent(this, mymap.class); startactivity(intent); // in response button } }
have tried @ post? seems changing xml match class name fixes issues.
Comments
Post a Comment