javaandroidtasker

I want to know if the activity of my app was called from Tasker


I want to know if the activity of my app was called from Tasker. Is there a way to determine this?

I tried the following code. However, none of the code was able to obtain information that was Tasker.

// [1] null was returned.
getCallingActivity();

// [2] null was returned too.
getCallingPackage();

Please let me know how. Thank you.


Solution

  • That's a quite advanced feature you are asking for. I am not familiar with it. If you are initiating the activity yourself from tasker you should be able to do some bookkeeping around the activity call. You might

    push %TIMES to an array %Bookkeeping() on place 1 
    and pop element N if %Bookkeeping(#)>N-1
    

    that way you can always see the last N times you called the activity through Tasker without your memory getting full. There is an option "seconds to date time" under "convert variable" which might come in handy when looking back.