eclipse - Android force close when button clicked -


the application force close when click button. java, xml , manifest have no error. don't understand why application force closing when click button. java code.

package com.aza.geopi;  import android.app.activity; import android.os.bundle; import android.content.intent; import android.widget.button; import android.view.view;  public class menuactivity extends activity implements view.onclicklistener {     /** called when activity first created. */  button materi;  @override  public void oncreate(bundle savedinstancestate) {     super.oncreate(savedinstancestate);     setcontentview(r.layout.activity_menu);      materi = (button)findviewbyid(r.id.button1);     materi.setonclicklistener(this); }  public void onclick(view view){     if (view==materi) {         intent intent = new intent (menuactivity.this, materi.class);         startactivityforresult (intent, 0);     } }  } 

this xml code

<absolutelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/absolutelayout1" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/mainmenu" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" tools:context=".menuactivity" >  <button     android:id="@+id/button1"     style="?android:attr/buttonstylesmall"     android:layout_width="210dp"     android:layout_height="68dp"     android:layout_x="80dp"     android:layout_y="160dp"     android:background="@android:color/transparent"     android:text="" />  <button     android:id="@+id/button2"     style="?android:attr/buttonstylesmall"     android:layout_width="210dp"     android:layout_height="68dp"     android:layout_x="88dp"     android:layout_y="256dp"     android:background="@android:color/transparent"     android:text="" />  <button     android:id="@+id/button3"     style="?android:attr/buttonstylesmall"     android:layout_width="210dp"     android:layout_height="68dp"     android:layout_x="80dp"     android:layout_y="355dp"     android:background="@android:color/transparent"     android:text="" /> 

the second class

package com.aza.geopi;  import android.app.activity; import android.os.bundle;  public class materi extends activity { /** called when activity first created. */ @override public void oncreate(bundle savedinstancestate) {     super.oncreate(savedinstancestate);     setcontentview(r.layout.materi);     } } 

the manifest

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.aza.geopi" android:versioncode="1" android:versionname="1.0" >  <uses-sdk     android:minsdkversion="8"     android:targetsdkversion="8" />  <application     android:allowbackup="true"     android:icon="@drawable/ic_launcher"     android:label="@string/app_name"     android:theme="@style/apptheme" >     <activity         android:name="com.aza.geopi.menuactivity"         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="materi">     </activity>  </application> 

logcat

>  05-15 08:59:55.977: d/dalvikvm(272): gc_external_alloc freed 745 > objects / 54592 bytes in 76ms >     05-15 09:00:04.106: e/dalvikvm-heap(272): 18933750-byte external allocation large process. >     05-15 09:00:04.106: e/graphicsjni(272): vm won't let allocate 18933750 bytes >     05-15 09:00:04.126: d/androidruntime(272): shutting down vm >     05-15 09:00:04.126: w/dalvikvm(272): threadid=1: thread exiting uncaught exception (group=0x4001d800) >     05-15 09:00:04.196: e/androidruntime(272): fatal exception: main >     05-15 09:00:04.196: e/androidruntime(272): java.lang.runtimeexception: unable start activity > componentinfo{com.aza.geopi/com.aza.geopi.materi}: > android.view.inflateexception: binary xml file line #2: error > inflating class <unknown> >     05-15 09:00:04.196: e/androidruntime(272):  @ android.app.activitythread.performlaunchactivity(activitythread.java:2663) >     05-15 09:00:04.196: e/androidruntime(272):  @ android.app.activitythread.handlelaunchactivity(activitythread.java:2679) >     05-15 09:00:04.196: e/androidruntime(272):  @ android.app.activitythread.access$2300(activitythread.java:125) >     05-15 09:00:04.196: e/androidruntime(272):  @ android.app.activitythread$h.handlemessage(activitythread.java:2033) >     05-15 09:00:04.196: e/androidruntime(272):  @ android.os.handler.dispatchmessage(handler.java:99) >     05-15 09:00:04.196: e/androidruntime(272):  @ android.os.looper.loop(looper.java:123) >     05-15 09:00:04.196: e/androidruntime(272):  @ android.app.activitythread.main(activitythread.java:4627) >     05-15 09:00:04.196: e/androidruntime(272):  @ java.lang.reflect.method.invokenative(native method) >     05-15 09:00:04.196: e/androidruntime(272):  @ java.lang.reflect.method.invoke(method.java:521) >     05-15 09:00:04.196: e/androidruntime(272):  @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:868) >     05-15 09:00:04.196: e/androidruntime(272):  @ com.android.internal.os.zygoteinit.main(zygoteinit.java:626) >     05-15 09:00:04.196: e/androidruntime(272):  @ dalvik.system.nativestart.main(native method) >     05-15 09:00:04.196: e/androidruntime(272): caused by: android.view.inflateexception: binary xml file line #2: error > inflating class <unknown> >     05-15 09:00:04.196: e/androidruntime(272):  @ android.view.layoutinflater.createview(layoutinflater.java:513) >     05-15 09:00:04.196: e/androidruntime(272):  @ com.android.internal.policy.impl.phonelayoutinflater.oncreateview(phonelayoutinflater.java:56) >     05-15 09:00:04.196: e/androidruntime(272):  @ android.view.layoutinflater.createviewfromtag(layoutinflater.java:563) >     05-15 09:00:04.196: e/androidruntime(272):  @ android.view.layoutinflater.inflate(layoutinflater.java:385) >     05-15 09:00:04.196: e/androidruntime(272):  @ android.view.layoutinflater.inflate(layoutinflater.java:320) >     05-15 09:00:04.196: e/androidruntime(272):  @ android.view.layoutinflater.inflate(layoutinflater.java:276) >     05-15 09:00:04.196: e/androidruntime(272):  @ com.android.internal.policy.impl.phonewindow.setcontentview(phonewindow.java:198) >     05-15 09:00:04.196: e/androidruntime(272):  @ android.app.activity.setcontentview(activity.java:1647) >     05-15 09:00:04.196: e/androidruntime(272):  @ com.aza.geopi.materi.oncreate(materi.java:11) >     05-15 09:00:04.196: e/androidruntime(272):  @ android.app.instrumentation.callactivityoncreate(instrumentation.java:1047) >     05-15 09:00:04.196: e/androidruntime(272):  @ android.app.activitythread.performlaunchactivity(activitythread.java:2627) >     05-15 09:00:04.196: e/androidruntime(272):  ... 11 more >     05-15 09:00:04.196: e/androidruntime(272): caused by: java.lang.reflect.invocationtargetexception >     05-15 09:00:04.196: e/androidruntime(272):  @ android.widget.absolutelayout.<init>(absolutelayout.java:47) >     05-15 09:00:04.196: e/androidruntime(272):  @ java.lang.reflect.constructor.constructnative(native method) >     05-15 09:00:04.196: e/androidruntime(272):  @ java.lang.reflect.constructor.newinstance(constructor.java:446) >     05-15 09:00:04.196: e/androidruntime(272):  @ android.view.layoutinflater.createview(layoutinflater.java:500) >     05-15 09:00:04.196: e/androidruntime(272):  ... 21 more >     05-15 09:00:04.196: e/androidruntime(272): caused by: java.lang.outofmemoryerror: bitmap size exceeds vm budget >     05-15 09:00:04.196: e/androidruntime(272):  @ android.graphics.bitmap.nativecreate(native method) >     05-15 09:00:04.196: e/androidruntime(272):  @ android.graphics.bitmap.createbitmap(bitmap.java:468) >     05-15 09:00:04.196: e/androidruntime(272):  @ android.graphics.bitmap.createbitmap(bitmap.java:435) >     05-15 09:00:04.196: e/androidruntime(272):  @ android.graphics.bitmap.createscaledbitmap(bitmap.java:340) >     05-15 09:00:04.196: e/androidruntime(272):  @ android.graphics.bitmapfactory.finishdecode(bitmapfactory.java:488) >     05-15 09:00:04.196: e/androidruntime(272):  @ android.graphics.bitmapfactory.decodestream(bitmapfactory.java:462) >     05-15 09:00:04.196: e/androidruntime(272):  @ android.graphics.bitmapfactory.decoderesourcestream(bitmapfactory.java:323) >     05-15 09:00:04.196: e/androidruntime(272):  @ android.graphics.drawable.drawable.createfromresourcestream(drawable.java:697) >     05-15 09:00:04.196: e/androidruntime(272):  @ android.content.res.resources.loaddrawable(resources.java:1709) >     05-15 09:00:04.196: e/androidruntime(272):  @ android.content.res.typedarray.getdrawable(typedarray.java:601) >     05-15 09:00:04.196: e/androidruntime(272):  @ android.view.view.<init>(view.java:1885) >     05-15 09:00:04.196: e/androidruntime(272):  @ android.view.view.<init>(view.java:1834) >     05-15 09:00:04.196: e/androidruntime(272):  @ android.view.viewgroup.<init>(viewgroup.java:285) >     05-15 09:00:04.196: e/androidruntime(272):  ... 25 more >     05-15 09:00:08.805: i/process(272): sending signal. pid: 272 sig: 9 >     05-15 09:24:41.886: d/dalvikvm(301): gc_external_alloc freed 767 objects / 55448 bytes in 77ms >     05-15 09:25:13.296: e/dalvikvm-heap(301): 18933750-byte external allocation large process. >     05-15 09:25:13.296: e/graphicsjni(301): vm won't let allocate 18933750 bytes >     05-15 09:25:13.296: d/androidruntime(301): shutting down vm >     05-15 09:25:13.305: w/dalvikvm(301): threadid=1: thread exiting uncaught exception (group=0x4001d800) >     05-15 09:25:13.336: e/androidruntime(301): fatal exception: main >     05-15 09:25:13.336: e/androidruntime(301): java.lang.runtimeexception: unable start activity > componentinfo{com.aza.geopi/com.aza.geopi.materi}: > android.view.inflateexception: binary xml file line #2: error > inflating class <unknown> >     05-15 09:25:13.336: e/androidruntime(301):  @ android.app.activitythread.performlaunchactivity(activitythread.java:2663) >     05-15 09:25:13.336: e/androidruntime(301):  @ android.app.activitythread.handlelaunchactivity(activitythread.java:2679) >     05-15 09:25:13.336: e/androidruntime(301):  @ android.app.activitythread.access$2300(activitythread.java:125) >     05-15 09:25:13.336: e/androidruntime(301):  @ android.app.activitythread$h.handlemessage(activitythread.java:2033) >     05-15 09:25:13.336: e/androidruntime(301):  @ android.os.handler.dispatchmessage(handler.java:99) >     05-15 09:25:13.336: e/androidruntime(301):  @ android.os.looper.loop(looper.java:123) >     05-15 09:25:13.336: e/androidruntime(301):  @ android.app.activitythread.main(activitythread.java:4627) >     05-15 09:25:13.336: e/androidruntime(301):  @ java.lang.reflect.method.invokenative(native method) >     05-15 09:25:13.336: e/androidruntime(301):  @ java.lang.reflect.method.invoke(method.java:521) >     05-15 09:25:13.336: e/androidruntime(301):  @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:868) >     05-15 09:25:13.336: e/androidruntime(301):  @ com.android.internal.os.zygoteinit.main(zygoteinit.java:626) >     05-15 09:25:13.336: e/androidruntime(301):  @ dalvik.system.nativestart.main(native method) >     05-15 09:25:13.336: e/androidruntime(301): caused by: android.view.inflateexception: binary xml file line #2: error > inflating class <unknown> >     05-15 09:25:13.336: e/androidruntime(301):  @ android.view.layoutinflater.createview(layoutinflater.java:513) >     05-15 09:25:13.336: e/androidruntime(301):  @ com.android.internal.policy.impl.phonelayoutinflater.oncreateview(phonelayoutinflater.java:56) >     05-15 09:25:13.336: e/androidruntime(301):  @ android.view.layoutinflater.createviewfromtag(layoutinflater.java:563) >     05-15 09:25:13.336: e/androidruntime(301):  @ android.view.layoutinflater.inflate(layoutinflater.java:385) >     05-15 09:25:13.336: e/androidruntime(301):  @ android.view.layoutinflater.inflate(layoutinflater.java:320) >     05-15 09:25:13.336: e/androidruntime(301):  @ android.view.layoutinflater.inflate(layoutinflater.java:276) >     05-15 09:25:13.336: e/androidruntime(301):  @ com.android.internal.policy.impl.phonewindow.setcontentview(phonewindow.java:198) >     05-15 09:25:13.336: e/androidruntime(301):  @ android.app.activity.setcontentview(activity.java:1647) >     05-15 09:25:13.336: e/androidruntime(301):  @ com.aza.geopi.materi.oncreate(materi.java:11) >     05-15 09:25:13.336: e/androidruntime(301):  @ android.app.instrumentation.callactivityoncreate(instrumentation.java:1047) >     05-15 09:25:13.336: e/androidruntime(301):  @ android.app.activitythread.performlaunchactivity(activitythread.java:2627) >     05-15 09:25:13.336: e/androidruntime(301):  ... 11 more >     05-15 09:25:13.336: e/androidruntime(301): caused by: java.lang.reflect.invocationtargetexception >     05-15 09:25:13.336: e/androidruntime(301):  @ android.widget.absolutelayout.<init>(absolutelayout.java:47) >     05-15 09:25:13.336: e/androidruntime(301):  @ java.lang.reflect.constructor.constructnative(native method) >     05-15 09:25:13.336: e/androidruntime(301):  @ java.lang.reflect.constructor.newinstance(constructor.java:446) >     05-15 09:25:13.336: e/androidruntime(301):  @ android.view.layoutinflater.createview(layoutinflater.java:500) >     05-15 09:25:13.336: e/androidruntime(301):  ... 21 more >     05-15 09:25:13.336: e/androidruntime(301): caused by: java.lang.outofmemoryerror: bitmap size exceeds vm budget >     05-15 09:25:13.336: e/androidruntime(301):  @ android.graphics.bitmap.nativecreate(native method) >     05-15 09:25:13.336: e/androidruntime(301):  @ android.graphics.bitmap.createbitmap(bitmap.java:468) >     05-15 09:25:13.336: e/androidruntime(301):  @ android.graphics.bitmap.createbitmap(bitmap.java:435) >     05-15 09:25:13.336: e/androidruntime(301):  @ android.graphics.bitmap.createscaledbitmap(bitmap.java:340) >     05-15 09:25:13.336: e/androidruntime(301):  @ android.graphics.bitmapfactory.finishdecode(bitmapfactory.java:488) >     05-15 09:25:13.336: e/androidruntime(301):  @ android.graphics.bitmapfactory.decodestream(bitmapfactory.java:462) >     05-15 09:25:13.336: e/androidruntime(301):  @ android.graphics.bitmapfactory.decoderesourcestream(bitmapfactory.java:323) >     05-15 09:25:13.336: e/androidruntime(301):  @ android.graphics.drawable.drawable.createfromresourcestream(drawable.java:697) >     05-15 09:25:13.336: e/androidruntime(301):  @ android.content.res.resources.loaddrawable(resources.java:1709) >     05-15 09:25:13.336: e/androidruntime(301):  @ android.content.res.typedarray.getdrawable(typedarray.java:601) >     05-15 09:25:13.336: e/androidruntime(301):  @ android.view.view.<init>(view.java:1885) >     05-15 09:25:13.336: e/androidruntime(301):  @ android.view.view.<init>(view.java:1834) >     05-15 09:25:13.336: e/androidruntime(301):  @ android.view.viewgroup.<init>(viewgroup.java:285) >     05-15 09:25:13.336: e/androidruntime(301):  ... 25 more >     05-15 09:25:15.475: i/process(301): sending signal. pid: 301 sig: 9 >     05-15 09:41:23.535: d/dalvikvm(330): gc_external_alloc freed 789 objects / 56304 bytes in 83ms >     05-15 09:41:30.596: e/dalvikvm-heap(330): 18933750-byte external allocation large process. >     05-15 09:41:30.596: e/graphicsjni(330): vm won't let allocate 18933750 bytes >     05-15 09:41:30.606: d/androidruntime(330): shutting down vm >     05-15 09:41:30.606: w/dalvikvm(330): threadid=1: thread exiting uncaught exception (group=0x4001d800) >     05-15 09:41:30.646: e/androidruntime(330): fatal exception: main >     05-15 09:41:30.646: e/androidruntime(330): java.lang.runtimeexception: unable start activity > componentinfo{com.aza.geopi/com.aza.geopi.materi}: > android.view.inflateexception: binary xml file line #2: error > inflating class <unknown> >     05-15 09:41:30.646: e/androidruntime(330):  @ android.app.activitythread.performlaunchactivity(activitythread.java:2663) >     05-15 09:41:30.646: e/androidruntime(330):  @ android.app.activitythread.handlelaunchactivity(activitythread.java:2679) >     05-15 09:41:30.646: e/androidruntime(330):  @ android.app.activitythread.access$2300(activitythread.java:125) >     05-15 09:41:30.646: e/androidruntime(330):  @ android.app.activitythread$h.handlemessage(activitythread.java:2033) >     05-15 09:41:30.646: e/androidruntime(330):  @ android.os.handler.dispatchmessage(handler.java:99) >     05-15 09:41:30.646: e/androidruntime(330):  @ android.os.looper.loop(looper.java:123) >     05-15 09:41:30.646: e/androidruntime(330):  @ android.app.activitythread.main(activitythread.java:4627) >     05-15 09:41:30.646: e/androidruntime(330):  @ java.lang.reflect.method.invokenative(native method) >     05-15 09:41:30.646: e/androidruntime(330):  @ java.lang.reflect.method.invoke(method.java:521) >     05-15 09:41:30.646: e/androidruntime(330):  @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:868) >     05-15 09:41:30.646: e/androidruntime(330):  @ com.android.internal.os.zygoteinit.main(zygoteinit.java:626) >     05-15 09:41:30.646: e/androidruntime(330):  @ dalvik.system.nativestart.main(native method) >     05-15 09:41:30.646: e/androidruntime(330): caused by: android.view.inflateexception: binary xml file line #2: error > inflating class <unknown> >     05-15 09:41:30.646: e/androidruntime(330):  @ android.view.layoutinflater.createview(layoutinflater.java:513) >     05-15 09:41:30.646: e/androidruntime(330):  @ com.android.internal.policy.impl.phonelayoutinflater.oncreateview(phonelayoutinflater.java:56) >     05-15 09:41:30.646: e/androidruntime(330):  @ android.view.layoutinflater.createviewfromtag(layoutinflater.java:563) >     05-15 09:41:30.646: e/androidruntime(330):  @ android.view.layoutinflater.inflate(layoutinflater.java:385) >     05-15 09:41:30.646: e/androidruntime(330):  @ android.view.layoutinflater.inflate(layoutinflater.java:320) >     05-15 09:41:30.646: e/androidruntime(330):  @ android.view.layoutinflater.inflate(layoutinflater.java:276) >     05-15 09:41:30.646: e/androidruntime(330):  @ com.android.internal.policy.impl.phonewindow.setcontentview(phonewindow.java:198) >     05-15 09:41:30.646: e/androidruntime(330):  @ android.app.activity.setcontentview(activity.java:1647) >     05-15 09:41:30.646: e/androidruntime(330):  @ com.aza.geopi.materi.oncreate(materi.java:11) >     05-15 09:41:30.646: e/androidruntime(330):  @ android.app.instrumentation.callactivityoncreate(instrumentation.java:1047) >     05-15 09:41:30.646: e/androidruntime(330):  @ android.app.activitythread.performlaunchactivity(activitythread.java:2627) >     05-15 09:41:30.646: e/androidruntime(330):  ... 11 more >     05-15 09:41:30.646: e/androidruntime(330): caused by: java.lang.reflect.invocationtargetexception >     05-15 09:41:30.646: e/androidruntime(330):  @ android.widget.absolutelayout.<init>(absolutelayout.java:47) >     05-15 09:41:30.646: e/androidruntime(330):  @ java.lang.reflect.constructor.constructnative(native method) >     05-15 09:41:30.646: e/androidruntime(330):  @ java.lang.reflect.constructor.newinstance(constructor.java:446) >     05-15 09:41:30.646: e/androidruntime(330):  @ android.view.layoutinflater.createview(layoutinflater.java:500) >     05-15 09:41:30.646: e/androidruntime(330):  ... 21 more >     05-15 09:41:30.646: e/androidruntime(330): caused by: java.lang.outofmemoryerror: bitmap size exceeds vm budget >     05-15 09:41:30.646: e/androidruntime(330):  @ android.graphics.bitmap.nativecreate(native method) >     05-15 09:41:30.646: e/androidruntime(330):  @ android.graphics.bitmap.createbitmap(bitmap.java:468) >     05-15 09:41:30.646: e/androidruntime(330):  @ android.graphics.bitmap.createbitmap(bitmap.java:435) >     05-15 09:41:30.646: e/androidruntime(330):  @ android.graphics.bitmap.createscaledbitmap(bitmap.java:340) >     05-15 09:41:30.646: e/androidruntime(330):  @ android.graphics.bitmapfactory.finishdecode(bitmapfactory.java:488) >     05-15 09:41:30.646: e/androidruntime(330):  @ android.graphics.bitmapfactory.decodestream(bitmapfactory.java:462) >     05-15 09:41:30.646: e/androidruntime(330):  @ android.graphics.bitmapfactory.decoderesourcestream(bitmapfactory.java:323) >     05-15 09:41:30.646: e/androidruntime(330):  @ android.graphics.drawable.drawable.createfromresourcestream(drawable.java:697) >     05-15 09:41:30.646: e/androidruntime(330):  @ android.content.res.resources.loaddrawable(resources.java:1709) >     05-15 09:41:30.646: e/androidruntime(330):  @ android.content.res.typedarray.getdrawable(typedarray.java:601) >     05-15 09:41:30.646: e/androidruntime(330):  @ android.view.view.<init>(view.java:1885) >     05-15 09:41:30.646: e/androidruntime(330):  @ android.view.view.<init>(view.java:1834) >     05-15 09:41:30.646: e/androidruntime(330):  @ android.view.viewgroup.<init>(viewgroup.java:285) >     05-15 09:41:30.646: e/androidruntime(330):  ... 25 more 

thanks before

the error "out of memory". looks using large bitmap using memory app can access on device or emulator using.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

keyboard - C++ GetAsyncKeyState alternative -

android - java.net.UnknownHostException(Unable to resolve host “URL”: No address associated with hostname) -