errors on android, trying to link an activity to mapactivity and vice versa -
i got issue dont know how resolve it, can explain me how resolve ? think problem on linking activity mapactivity.. why ? because android application running before mapactivity , when try put more contents application, cannot run application , show me error on samsung galaxy s4 "unfortunately,lcidadao has stopped."
05-18 22:18:53.212: d/skia(23942): ---- fasset->read(2074) returned 0 05-18 22:18:53.252: w/resourcetype(23942): bad xml block: header size 18254 or total size 169478669 larger data size 6480 05-18 22:18:53.252: d/androidruntime(23942): shutting down vm 05-18 22:18:53.252: w/dalvikvm(23942): threadid=1: thread exiting uncaught exception (group=0x40fa1ac8) 05-18 22:18:53.252: e/androidruntime(23942): fatal exception: main 05-18 22:18:53.252: e/androidruntime(23942): java.lang.runtimeexception: unable start activity componentinfo{com.example.basicmaponline/com.example.basicmaponline.intro}: android.content.res.resources$notfoundexception: file res/drawable/intro.png xml type layout resource id #0x7f020001 05-18 22:18:53.252: e/androidruntime(23942): @ android.app.activitythread.performlaunchactivity(activitythread.java:2246) 05-18 22:18:53.252: e/androidruntime(23942): @ android.app.activitythread.handlelaunchactivity(activitythread.java:2296) 05-18 22:18:53.252: e/androidruntime(23942): @ android.app.activitythread.access$700(activitythread.java:151) 05-18 22:18:53.252: e/androidruntime(23942): @ android.app.activitythread$h.handlemessage(activitythread.java:1281) 05-18 22:18:53.252: e/androidruntime(23942): @ android.os.handler.dispatchmessage(handler.java:99) 05-18 22:18:53.252: e/androidruntime(23942): @ android.os.looper.loop(looper.java:137) 05-18 22:18:53.252: e/androidruntime(23942): @ android.app.activitythread.main(activitythread.java:5293) 05-18 22:18:53.252: e/androidruntime(23942): @ java.lang.reflect.method.invokenative(native method) 05-18 22:18:53.252: e/androidruntime(23942): @ java.lang.reflect.method.invoke(method.java:511) 05-18 22:18:53.252: e/androidruntime(23942): @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:1102) 05-18 22:18:53.252: e/androidruntime(23942): @ com.android.internal.os.zygoteinit.main(zygoteinit.java:869) 05-18 22:18:53.252: e/androidruntime(23942): @ dalvik.system.nativestart.main(native method) 05-18 22:18:53.252: e/androidruntime(23942): caused by: android.content.res.resources$notfoundexception: file res/drawable/intro.png xml type layout resource id #0x7f020001 05-18 22:18:53.252: e/androidruntime(23942): @ android.content.res.resources.loadxmlresourceparser(resources.java:3083) 05-18 22:18:53.252: e/androidruntime(23942): @ android.content.res.resources.loadxmlresourceparser(resources.java:3030) 05-18 22:18:53.252: e/androidruntime(23942): @ android.content.res.resources.getlayout(resources.java:1722) 05-18 22:18:53.252: e/androidruntime(23942): @ android.view.layoutinflater.inflate(layoutinflater.java:395) 05-18 22:18:53.252: e/androidruntime(23942): @ android.view.layoutinflater.inflate(layoutinflater.java:353) 05-18 22:18:53.252: e/androidruntime(23942): @ com.android.internal.policy.impl.phonewindow.setcontentview(phonewindow.java:327) 05-18 22:18:53.252: e/androidruntime(23942): @ android.app.activity.setcontentview(activity.java:1928) 05-18 22:18:53.252: e/androidruntime(23942): @ com.example.basicmaponline.intro.oncreate(intro.java:13) 05-18 22:18:53.252: e/androidruntime(23942): @ android.app.activity.performcreate(activity.java:5250) 05-18 22:18:53.252: e/androidruntime(23942): @ android.app.instrumentation.callactivityoncreate(instrumentation.java:1097) 05-18 22:18:53.252: e/androidruntime(23942): @ android.app.activitythread.performlaunchactivity(activitythread.java:2210) -18 22:18:53.252: e/androidruntime(23942): ... 11 more 05-18 22:18:53.252: e/androidruntime(23942): caused by: java.io.filenotfoundexception: corrupt xml binary file 05-18 22:18:53.252: e/androidruntime(23942): @ android.content.res.assetmanager.openxmlassetnative(native method) 05-18 22:18:53.252: e/androidruntime(23942): @ android.content.res.assetmanager.openxmlblockasset(assetmanager.java:487) 05-18 22:18:53.252: e/androidruntime(23942): @ android.content.res.resources.loadxmlresourceparser(resources.java:3061) 05-18 22:18:53.252: e/androidruntime(23942): ... 21 more
my manifste.xml:
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.basicmaponline" android:versioncode="1" android:versionname="1.0" > <uses-sdk android:minsdkversion="11" android:targetsdkversion="17" /> <uses-permission android:name="android.permission.write_external_storage"/> <uses-permission android:name="android.permission.internet"/> <application android:allowbackup="true" android:icon="@drawable/lojacidadao" android:label="@string/app_name" android:theme="@style/apptheme" > <activity android:name="com.example.basicmaponline.intro" 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.basicmaponline.mainactivity" android:label="@string/app_name" > <intent-filter> <action android:name="com.example.basicmaponline.mainactivity" /> <category android:name="android.intent.category.default" /> </intent-filter> </activity> </application> </manifest>
my intro.java (extends activity) introduction of application , main_activity.java (extends mapactivity) map implements mapsforge .jar.
intro.java:
package com.example.basicmaponline; import android.app.activity; import android.content.intent; import android.os.bundle; public class intro extends activity{ @override protected void oncreate(bundle savedinstancestate) { // todo auto-generated method stub super.oncreate(savedinstancestate); setcontentview(r.drawable.intro); thread timer = new thread(){ public void run(){ try{ sleep(5000); }catch (interruptedexception e) { // todo: handle exception e.printstacktrace(); }finally{ /*which activity run after doing these codes*/ /*"com.example.testesdz.mainactivity" ver androidmanifest.xml , está relacionado com uma activity (class neste caso)*/ intent openmainactivity = new intent("com.example.basicmaponline.mainactivity"); //isto vem ficheiro androidmanifest.xml o "com.example....." startactivity(openmainactivity); } } }; timer.start(); } @override protected void onpause() { // todo auto-generated method stub super.onpause(); //oursong.release(); //release music , done finish(); } }
the file res/drawable/intro.png not found. if have file in project, clean , refresh projecto. r.java not refreshed correctly
update
change
setcontentview(r.drawable.intro);
to
setcontentview(r.layout.intro);
Comments
Post a Comment