titanium - Appcelerator ti.paint module won't load image on android -


i have error ti.paint module on android. whenever try set image, application crashes (works fine on ios) i've try several codes :

var paintview = paint.createpaintview({     top:0, right:0, bottom:80, left:0,     image : "images/doge.png",     erasemode : true,     strokewidth : 70 }); 

and

image : "/images/doge.png" 

also

image = "http://dogr.io/doge.png" 

and finally

var dogefile = titanium.filesystem.getfile(ti.filesystem.resourcesdirectory, 'images/doge.png'); var paintview = paint.createpaintview({     top:0, right:0, bottom:80, left:0,     image : dogefile.nativepath,     erasemode : true,     strokewidth : 70 }); 

but application crash each time on android (works fine on ios).

i've tried jpeg images, , null value.

here error message i'm getting in console

[error] tiapplication: (main) [0,205] sending event: exception on thread: main msg:java.lang.runtimeexception: unable start activity componentinfo{wow.much.scratch/org.appcelerator.titanium.tiactivity}: java.lang.nullpointerexception; titanium 3.2.3,2014/04/22 10:17,b958a70 [error] tiapplication: java.lang.runtimeexception: unable start activity componentinfo{wow.much.scratch/org.appcelerator.titanium.tiactivity}: java.lang.nullpointerexception [error] tiapplication:  @ android.app.activitythread.performlaunchactivity(activitythread.java:2211) [error] tiapplication:  @ android.app.activitythread.handlelaunchactivity(activitythread.java:2261) [error] tiapplication:  @ android.app.activitythread.access$600(activitythread.java:141) [error] tiapplication:  @ android.app.activitythread$h.handlemessage(activitythread.java:1256) [error] tiapplication:  @ android.os.handler.dispatchmessage(handler.java:99) [error] tiapplication:  @ android.os.looper.loop(looper.java:137) [error] tiapplication:  @ android.app.activitythread.main(activitythread.java:5103) [error] tiapplication:  @ java.lang.reflect.method.invokenative(native method) [error] tiapplication:  @ java.lang.reflect.method.invoke(method.java:525) [error] tiapplication:  @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:737) [error] tiapplication:  @ com.android.internal.os.zygoteinit.main(zygoteinit.java:553) [error] tiapplication:  @ dalvik.system.nativestart.main(native method) [error] tiapplication: caused by: java.lang.nullpointerexception [error] tiapplication:  @ ti.modules.titanium.paint.uipaintview$paintview.setimage(uipaintview.java:224) [error] tiapplication:  @ ti.modules.titanium.paint.uipaintview.<init>(uipaintview.java:42) [error] tiapplication:  @ ti.modules.titanium.paint.paintviewproxy.createview(paintviewproxy.java:30) [error] tiapplication:  @ org.appcelerator.titanium.proxy.tiviewproxy.handlegetview(tiviewproxy.java:463) [error] tiapplication:  @ org.appcelerator.titanium.proxy.tiviewproxy.getorcreateview(tiviewproxy.java:449) [error] tiapplication:  @ org.appcelerator.titanium.proxy.tiviewproxy.realizeviews(tiviewproxy.java:487) [error] tiapplication:  @ org.appcelerator.titanium.proxy.tiviewproxy.handlegetview(tiviewproxy.java:471) [error] tiapplication:  @ org.appcelerator.titanium.proxy.tiviewproxy.getorcreateview(tiviewproxy.java:449) [error] tiapplication:  @ org.appcelerator.titanium.proxy.tiviewproxy.handleadd(tiviewproxy.java:566) [error] tiapplication:  @ org.appcelerator.titanium.proxy.tiviewproxy.add(tiviewproxy.java:544) [error] tiapplication:  @ ti.modules.titanium.ui.windowproxy.windowcreated(windowproxy.java:303) [error] tiapplication:  @ org.appcelerator.titanium.tiactivitywindows.windowcreated(tiactivitywindows.java:32) [error] tiapplication:  @ org.appcelerator.titanium.tibaseactivity.windowcreated(tibaseactivity.java:452) [error] tiapplication:  @ org.appcelerator.titanium.tibaseactivity.oncreate(tibaseactivity.java:528) [error] tiapplication:  @ org.appcelerator.titanium.tiactivity.oncreate(tiactivity.java:18) [error] tiapplication:  @ android.app.activity.performcreate(activity.java:5133) [error] tiapplication:  @ android.app.instrumentation.callactivityoncreate(instrumentation.java:1087) [error] tiapplication:  @ android.app.activitythread.performlaunchactivity(activitythread.java:2175) [error] tiapplication:  ... 11 more 

i'm running titanium sdk 3.2.3.ga.

any appreciated.

i work on ti.paint , met same problem android. management view android different of titanium, created problem... idea use main thread.

here change in paintviewproxy.java module :

@kroll.setproperty @kroll.method public void setimage(string imagepath) {     final string imgpath = imagepath;     getactivity().runonuithread(new runnable() {         @override         public void run() {             paintview.setimage(imgpath);         }     }); } 

recompile , should work, works me. hope have ...


Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -