android - How to get image name from imageview -
i have imageview has image loaded in it. way
// create bitmap resource bitmap bm = bitmapfactory.decoderesource(getresources(), r.drawable.profile_blank_xlarge); // set circle bitmap imageview mimage = (imageview) layout.findviewbyid(r.id.image); mimage.setimagebitmap(getcirclebitmap(bm));
i want able find out name of image in imageview
once application run.
i tried doing mimage.gettag()
name of image in imageview
crashes app. correct way name of image in imageview
crash details
--------- beginning of crash 07-02 13:11:37.259 2096-2096/com.example.kmi_dev.fbloginsample e/androidruntime﹕ fatal exception: main process: com.example.kmi_dev.fbloginsample, pid: 2096 java.lang.runtimeexception: unable start activity componentinfo{com.example.kmi_dev.fbloginsample/com.example.kmi_dev.fbloginsample.myactivity}: java.lang.nullpointerexception: attempt invoke virtual method 'java.lang.string java.lang.object.tostring()' on null object reference @ android.app.activitythread.performlaunchactivity(activitythread.java:2325) @ android.app.activitythread.handlelaunchactivity(activitythread.java:2390) @ android.app.activitythread.access$800(activitythread.java:151) @ android.app.activitythread$h.handlemessage(activitythread.java:1303) @ android.os.handler.dispatchmessage(handler.java:102) @ android.os.looper.loop(looper.java:135) @ android.app.activitythread.main(activitythread.java:5257) @ java.lang.reflect.method.invoke(native method) @ java.lang.reflect.method.invoke(method.java:372) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:903) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:698) caused by: java.lang.nullpointerexception: attempt invoke virtual method 'java.lang.string java.lang.object.tostring()' on null object reference @ com.example.kmi_dev.fbloginsample.myaccount.oncreateview(myaccount.java:115) @ android.app.fragment.performcreateview(fragment.java:2053) @ android.app.fragmentmanagerimpl.movetostate(fragmentmanager.java:894) @ android.app.fragmentmanagerimpl.movetostate(fragmentmanager.java:1067) @ android.app.backstackrecord.run(backstackrecord.java:834) @ android.app.fragmentmanagerimpl.execpendingactions(fragmentmanager.java:1452) @ android.app.activity.performstart(activity.java:6005) @ android.app.activitythread.performlaunchactivity(activitythread.java:2288) at android.app.activitythread.handlelaunchactivity(activitythread.java:2390) at android.app.activitythread.access$800(activitythread.java:151) at android.app.activitythread$h.handlemessage(activitythread.java:1303) at android.os.handler.dispatchmessage(handler.java:102) at android.os.looper.loop(looper.java:135) at android.app.activitythread.main(activitythread.java:5257) at java.lang.reflect.method.invoke(native method) at java.lang.reflect.method.invoke(method.java:372) at com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:903) at com.android.internal.os.zygoteinit.main(zygoteinit.java:698)
Comments
Post a Comment