intent receiver - PHONE_STATE, how to use?

133 views
Skip to first unread message

Josh Att

unread,
Aug 3, 2015, 10:36:55 AM8/3/15
to Tasker

hi,

I have this dual sim card android 4.4.4 phone. I find that Tasker v4.2 can not cope with the SECOND sim card --- when calling with second sim card, "phone off hook" can not be triggered.
So I'm planning to find a workaround - no matter which sim card is calling, there must be some sign. I googled and found this:
"broadcast:android.intent.action.PHONE_STATE
return:%state"

I tried:  profile - intent receiver - fill in with "android.intent.action.PHONE_STATE" or "broadcast:android.intent.action.PHONE_STATE".
But there's no place to fill in return variable, and there's no such %state in Variables table.

What's the right usage of this intent receiver?

Wayne Longford

unread,
Aug 3, 2015, 12:52:25 PM8/3/15
to Tasker
%state is a local variable and therefore only exists whilst the task associated with the profile is running.

If you want to keep a copy of it then save its value to a global variable i.e

A1: Variable Set [ Name:%State To:%state Do Maths:Off Append:Off ]

Only global variables are visible in the Variables tab. See the userguide for more about local vs global.

Wayne Longford

unread,
Aug 3, 2015, 12:55:27 PM8/3/15
to Tasker
Also, the correct intent is:

android.intent.action.PHONE_STATE

Reply all
Reply to author
Forward
0 new messages