Mariuxtheone / Teleport

Data Sync & Messaging Library for Android Wear
370 stars 47 forks source link

Cannot execute task: the task has already been executed (a task can be executed only once) #13

Closed ghost closed 10 years ago

ghost commented 10 years ago

Hi,

using your awesome library (v0.1.3). Have problem, when I fire sendMessage second time from phone to watch. It crashes with:

    java.lang.IllegalStateException: Cannot execute task: the task has already been executed (a task can be executed only once)
            at android.os.AsyncTask.executeOnExecutor(AsyncTask.java:579)
            at android.os.AsyncTask.execute(AsyncTask.java:535)
            at com.mariux.teleport.lib.TeleportService.onMessageReceived(TeleportService.java:309)
            at com.google.android.gms.wearable.WearableListenerService$a$2.run(Unknown Source)
            at android.os.Handler.handleCallback(Handler.java:733)
            at android.os.Handler.dispatchMessage(Handler.java:95)
            at android.os.Looper.loop(Looper.java:136)
            at android.os.HandlerThread.run(HandlerThread.java:61)

Any idea how to fix this? Thanks!

ghost commented 10 years ago
//let`s reset the task (otherwise it will be executed only once)
setOnGetMessageTask(new StartActivityTask());