java - App wont run on Eclipse emulator -


i trying check app have coded in eclipse. reason on emulator unable load. doesn't gives info other "unfortunately app has stopped". couldn't figure out why through logcat. if appreciate it.

here java code : package net.androidbootcamp.quickhealthysnackideasapp;

import android.support.v7.app.actionbaractivity; import android.content.context; import android.os.bundle; import android.view.menu; import android.view.menuitem; import android.view.view; import android.view.viewgroup; import android.widget.adapterview; import android.widget.adapterview.onitemclicklistener; import android.widget.baseadapter; import android.widget.gridview; import android.widget.imageview; import android.widget.toast;   public class mainactivity extends actionbaractivity {     integer[] snacks = {r.drawable.snack1, r.drawable.snack2, r.drawable.snack3,              r.drawable.snack4,r.drawable.snack5};     imageview pic;      @override     protected void oncreate(bundle savedinstancestate) {         super.oncreate(savedinstancestate);         setcontentview(r.layout.activity_main);         gridview gr = (gridview)findviewbyid(r.id.gridview1);         final imageview pic = (imageview)findviewbyid(r.id.imglarge);         gr.setadapter(new imageadapter(this));          gr.setonitemclicklistener(new onitemclicklistener(){              @override             public void onitemclick(adapterview<?> arg0, view arg1, int arg2,                 long arg3) {                 // todo auto-generated method stub                 toast.maketext(getbasecontext(), "selected snacks" + (arg2+1),             toast.length_short).show();                 pic.setimageresource(snacks[arg2]);            }          });          }     public class imageadapter extends baseadapter{     private context context;     public imageadapter(context c)      {         // todo auto-generated constructor stub         context = c;     }          @override         public int getcount() {            // todo auto-generated method stub            return snacks.length;         }          @override          public object getitem(int arg0) {             // todo auto-generated method stub             return null;         }         @override         public long getitemid(int arg0) {             // todo auto-generated method stub             return 0;         }          @override         public view getview(int arg0, view arg1, viewgroup arg2) {             // todo auto-generated method stub             pic = new imageview(context);             pic.setimageresource(snacks[arg0]);             pic.setscaletype(imageview.scaletype.fit_xy);             pic.setlayoutparams(new gridview.layoutparams(188,200));             return pic;         }      }       @override     public boolean oncreateoptionsmenu(menu menu) {         // inflate menu; adds items action bar if present.         getmenuinflater().inflate(r.menu.main, menu);         return true;     }      @override     public boolean onoptionsitemselected(menuitem item) {         // handle action bar item clicks here. action bar         // automatically handle clicks on home/up button, long         // specify parent activity in androidmanifest.xml.         int id = item.getitemid();         if (id == r.id.action_settings) {             return true;         }         return super.onoptionsitemselected(item);     } } 

here xml code:

<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" 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="net.androidbootcamp.quickhealthysnackideasapp.mainactivity" >  <gridview     android:id="@+id/gridview1"     android:layout_width="wrap_content"     android:layout_height="250dp"     android:numcolumns="3"     android:columnwidth="100dp"     android:horizontalspacing= "5dp"     android:verticalspacing= "5dp"> </gridview>  <imageview     android:id="@+id/imglarge"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:contentdescription="@string/imglarge"/> 

here logcat :

11-12 22:14:59.444: e/androidruntime(884): fatal exception: main 11-12 22:14:59.444: e/androidruntime(884): java.lang.runtimeexception: unable start activity componentinfo{net.androidbootcamp.quickhealthysnackideasapp/net.androidbootcamp.quickhealthysnackideasapp.mainactivity}: android.view.inflateexception: binary xml file line #21: error inflating class imageview 11-12 22:14:59.444: e/androidruntime(884):  @ android.app.activitythread.performlaunchactivity(activitythread.java:2211) 11-12 22:14:59.444: e/androidruntime(884):  @ android.app.activitythread.handlelaunchactivity(activitythread.java:2261) 11-12 22:14:59.444: e/androidruntime(884):  @ android.app.activitythread.access$600(activitythread.java:141) 11-12 22:14:59.444: e/androidruntime(884):  @ android.app.activitythread$h.handlemessage(activitythread.java:1256) 11-12 22:14:59.444: e/androidruntime(884):  @ android.os.handler.dispatchmessage(handler.java:99) 11-12 22:14:59.444: e/androidruntime(884):  @ android.os.looper.loop(looper.java:137) 11-12 22:14:59.444: e/androidruntime(884):  @ android.app.activitythread.main(activitythread.java:5103) 11-12 22:14:59.444: e/androidruntime(884):  @ java.lang.reflect.method.invokenative(native method) 11-12 22:14:59.444: e/androidruntime(884):  @ java.lang.reflect.method.invoke(method.java:525) 11-12 22:14:59.444: e/androidruntime(884):  @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:737) 11-12 22:14:59.444: e/androidruntime(884):  @ com.android.internal.os.zygoteinit.main(zygoteinit.java:553) 11-12 22:14:59.444: e/androidruntime(884):  @ dalvik.system.nativestart.main(native method) 11-12 22:14:59.444: e/androidruntime(884): caused by: android.view.inflateexception: binary xml file line #21: error inflating class imageview 11-12 22:14:59.444: e/androidruntime(884):  @ android.view.layoutinflater.createviewfromtag(layoutinflater.java:707) 11-12 22:14:59.444: e/androidruntime(884):  @ android.view.layoutinflater.rinflate(layoutinflater.java:755) 11-12 22:14:59.444: e/androidruntime(884):  @ android.view.layoutinflater.inflate(layoutinflater.java:492) 11-12 22:14:59.444: e/androidruntime(884):  @ android.view.layoutinflater.inflate(layoutinflater.java:397) 11-12 22:14:59.444: e/androidruntime(884):  @ android.view.layoutinflater.inflate(layoutinflater.java:353) 11-12 22:14:59.444: e/androidruntime(884):  @ com.android.internal.policy.impl.phonewindow.setcontentview(phonewindow.java:267) 11-12 22:14:59.444: e/androidruntime(884):  @ android.app.activity.setcontentview(activity.java:1895) 11-12 22:14:59.444: e/androidruntime(884):  @ android.support.v7.app.actionbaractivity.supersetcontentview(actionbaractivity.java:217) 11-12 22:14:59.444: e/androidruntime(884):  @ android.support.v7.app.actionbaractivitydelegateics.setcontentview(actionbaractivitydelegateics.java:110) 11-12 22:14:59.444: e/androidruntime(884):  @ android.support.v7.app.actionbaractivity.setcontentview(actionbaractivity.java:77) 11-12 22:14:59.444: e/androidruntime(884):  @ net.androidbootcamp.quickhealthysnackideasapp.mainactivity.oncreate(mainactivity.java:26) 11-12 22:14:59.444: e/androidruntime(884):  @ android.app.activity.performcreate(activity.java:5133) 11-12 22:14:59.444: e/androidruntime(884):  @ android.app.instrumentation.callactivityoncreate(instrumentation.java:1087) 11-12 22:14:59.444: e/androidruntime(884):  @ android.app.activitythread.performlaunchactivity(activitythread.java:2175) 11-12 22:14:59.444: e/androidruntime(884):  ... 11 more 11-12 22:14:59.444: e/androidruntime(884): caused by: java.lang.classnotfoundexception: didn't find class "android.view.imageview" on path: dexpathlist[[zip file "/data/app/net.androidbootcamp.quickhealthysnackideasapp-1.apk"],nativelibrarydirectories=[/data/app-lib/net.androidbootcamp.quickhealthysnackideasapp-1, /system/lib]] 11-12 22:14:59.444: e/androidruntime(884):  @ dalvik.system.basedexclassloader.findclass(basedexclassloader.java:53) 11-12 22:14:59.444: e/androidruntime(884):  @ java.lang.classloader.loadclass(classloader.java:501) 11-12 22:14:59.444: e/androidruntime(884):  @ java.lang.classloader.loadclass(classloader.java:461) 11-12 22:14:59.444: e/androidruntime(884):  @ android.view.layoutinflater.createview(layoutinflater.java:559) 11-12 22:14:59.444: e/androidruntime(884):  @ android.view.layoutinflater.oncreateview(layoutinflater.java:652) 11-12 22:14:59.444: e/androidruntime(884):  @ com.android.internal.policy.impl.phonelayoutinflater.oncreateview(phonelayoutinflater.java:66) 11-12 22:14:59.444: e/androidruntime(884):  @ android.view.layoutinflater.oncreateview(layoutinflater.java:669) 11-12 22:14:59.444: e/androidruntime(884):  @ android.view.layoutinflater.createviewfromtag(layoutinflater.java:694) 11-12 22:14:59.444: e/androidruntime(884):  ... 24 more 11-12 22:14:59.464: w/activitymanager(286):   force finishing activity net.androidbootcamp.quickhealthysnackideasapp/.mainactivity 11-12 22:14:59.814: i/windowmanager(286): screenshot max retries 4 of token{41b91b60 activityrecord{419a3ad0 u0 net.androidbootcamp.quickhealthysnackideasapp/.mainactivity}} appwin=window{41a40c28 u0 starting net.androidbootcamp.quickhealthysnackideasapp} drawstate=4 11-12 22:14:59.814: w/windowmanager(286): screenshot failure taking screenshot (800x1280) layer 21010 11-12 22:15:00.624: w/activitymanager(286): activity pause timeout activityrecord{419a3ad0 u0 net.androidbootcamp.quickhealthysnackideasapp/.mainactivity} 11-12 22:15:00.794: i/choreographer(286): skipped 42 frames!  application may doing work on main thread. 11-12 22:15:01.524: i/choreographer(405): skipped 57 frames!  application may doing work on main thread. 11-12 22:15:02.334: i/process(884): sending signal. pid: 884 sig: 9 11-12 22:15:02.394: i/activitymanager(286): process net.androidbootcamp.quickhealthysnackideasapp (pid 884) has died. 11-12 22:15:02.404: e/soundpool(286): error loading /system/media/audio/ui/effect_tick.ogg 11-12 22:15:02.404: w/audioservice(286): soundpool not load file: /system/media/audio/ui/effect_tick.ogg 11-12 22:15:02.404: e/soundpool(286): error loading /system/media/audio/ui/effect_tick.ogg 11-12 22:15:02.404: w/audioservice(286): soundpool not load file: /system/media/audio/ui/effect_tick.ogg 11-12 22:15:02.404: e/soundpool(286): error loading /system/media/audio/ui/effect_tick.ogg 11-12 22:15:02.404: w/audioservice(286): soundpool not load file: /system/media/audio/ui/effect_tick.ogg 11-12 22:15:02.404: e/soundpool(286): error loading /system/media/audio/ui/effect_tick.ogg 11-12 22:15:02.404: w/audioservice(286): soundpool not load file: /system/media/audio/ui/effect_tick.ogg 11-12 22:15:02.404: e/soundpool(286): error loading /system/media/audio/ui/effect_tick.ogg 11-12 22:15:02.404: w/audioservice(286): soundpool not load file: /system/media/audio/ui/effect_tick.ogg 11-12 22:15:02.404: e/soundpool(286): error loading /system/media/audio/ui/keypressstandard.ogg 11-12 22:15:02.404: w/audioservice(286): soundpool not load file: /system/media/audio/ui/keypressstandard.ogg 11-12 22:15:02.414: e/soundpool(286): error loading /system/media/audio/ui/keypressspacebar.ogg 11-12 22:15:02.414: w/audioservice(286): soundpool not load file: /system/media/audio/ui/keypressspacebar.ogg 11-12 22:15:02.414: e/soundpool(286): error loading /system/media/audio/ui/keypressdelete.ogg 11-12 22:15:02.414: w/audioservice(286): soundpool not load file: /system/media/audio/ui/keypressdelete.ogg 11-12 22:15:02.414: e/soundpool(286): error loading /system/media/audio/ui/keypressreturn.ogg 11-12 22:15:02.414: w/audioservice(286): soundpool not load file: /system/media/audio/ui/keypressreturn.ogg 11-12 22:15:02.414: w/audioservice(286): onloadsoundeffects(), error -1 while loading samples 11-12 22:15:03.144: w/inputmethodmanagerservice(286): window focused, ignoring focus gain of: com.android.internal.view.iinputmethodclient$stub$proxy@41a39458 attribute=null, token = android.os.binderproxy@41a4a920 11-12 22:15:04.714: i/qsb.suggestionsproviderimpl(825): chars:0,corpora:[web, apps, com.android.contacts/.activities.peopleactivity] 11-12 22:15:04.754: i/qsb.suggestionsproviderimpl(825): chars:0,corpora:[web, apps, com.android.contacts/.activities.peopleactivity] 11-12 22:19:30.394: i/activitymanager(286): no longer want android.process.acore (pid 452): empty 1805s 11-12 22:19:30.455: i/activitymanager(286): kill com.android.quicksearchbox (pid 825): provider com.android.providers.applications.applicationsprovider in dying process android.process.acore 11-12 22:19:30.465: i/activitymanager(286): kill com.android.quicksearchbox (pid 825): provider com.android.providers.contacts.contactsprovider2 in dying process android.process.acore 11-12 22:19:30.525: i/activitymanager(286): process com.android.quicksearchbox (pid 825) has died. 

lol :), change xml to

<imageview 

(with capital v)


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -