Quantcast
Channel: Appcelerator Developer Center Q&A Tag Feed (android)
Viewing all articles
Browse latest Browse all 7655

ImageView start() method crash app.

$
0
0

Hello.

I have an Android application and I'm trying to put an animation after the splashscreen, using the "images" field of the ImageView class.

However, when I call start method, the application stops and closes, with the log:

[WARN] :   dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x4156cba8)
[ERROR] :  TiApplication: (main) [9267,9267] Sending event: exception on thread: main msg:java.lang.IllegalThreadStateException: Thread already started; Titanium 3.2.1,2014/02/06 17:03,991027b
[ERROR] :  TiApplication: java.lang.IllegalThreadStateException: Thread already started
[ERROR] :  TiApplication:   at java.lang.Thread.checkNotStarted(Thread.java:871)
[ERROR] :  TiApplication:   at java.lang.Thread.start(Thread.java:1025)
[ERROR] :  TiApplication:   at ti.modules.titanium.ui.widget.TiUIImageView.handleStart(TiUIImageView.java:564)
[ERROR] :  TiApplication:   at ti.modules.titanium.ui.widget.TiUIImageView.handleMessage(TiUIImageView.java:211)
[ERROR] :  TiApplication:   at android.os.Handler.dispatchMessage(Handler.java:98)
[ERROR] :  TiApplication:   at android.os.Looper.loop(Looper.java:136)
[ERROR] :  TiApplication:   at android.app.ActivityThread.main(ActivityThread.java:5017)
[ERROR] :  TiApplication:   at java.lang.reflect.Method.invokeNative(Native Method)
[ERROR] :  TiApplication:   at java.lang.reflect.Method.invoke(Method.java:515)
[ERROR] :  TiApplication:   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
[ERROR] :  TiApplication:   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
[ERROR] :  TiApplication:   at dalvik.system.NativeStart.main(Native Method)
I've tried call start directly, and with event click of the ImageView, but the result is always the same.

My declaration of the ImageView is:

var imageAnimation = Ti.UI.createImageView({
 
    width:"100%",
    height:"100%",
 
    images : [
        '/images/animated1.png',
        '/images/animated2.png',
        '/images/animated3.png',
        '/images/animated4.png',
        '/images/animated5.png'
    ],
    duration:1000,
    repeatCount : 1
});
 
 
$.viewAnimation.add(imageAnimation);
 
 
imageAnimation.addEventListener("click",function(e){
 
    imageAnimation.start();
 
});
If I don't call start, the app doesn't crash. I've tested commenting the rest of the code in this controller, but the error appears too.

I'm using Titanium 3.2.1 in Ubuntu, and I've tested this in Android 2.3 and 4.4, on real devices.

Thanks for your help


Viewing all articles
Browse latest Browse all 7655

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>