Send Intent action to shutdown the WiFi

237 views
Skip to first unread message

M@xF@ctor

unread,
Dec 12, 2014, 8:53:33 AM12/12/14
to tas...@googlegroups.com
Hi all, 

I think my ROM has some bug that breaks 3rd party apps like Tasker when shutting down wifi (wifi status says "shutting down" forever, until phone hangs or restart by itself)

I was wondering if I can shut the wifi by sending an intent from takser to the android WifiManager instead of using its WiFi OFF action.

I found something like this

Intent configIntent = new Intent(android.provider.Settings.ACTION_WIRELESS_SETTINGS);
                   configIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                  this.startActivity(configIntent);         

but I don't know how to use this informartion to configure the send intent action of tasker.

Could someone help me in doing this?

Thanks in advance
Gian

Pent

unread,
Dec 12, 2014, 12:16:37 PM12/12/14
to tas...@googlegroups.com

Intent configIntent = new Intent(android.provider.Settings.ACTION_WIRELESS_SETTINGS);
                   configIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                  this.startActivity(configIntent);         

That just shows the Android settings screen so you can do it manually.

You can do the same with action Wireless Settings in the Settings action category.

Pent

M@xF@ctor

unread,
Dec 15, 2014, 3:58:26 AM12/15/14
to tas...@googlegroups.com
Thank you for the answer, but as I sayd "my ROM has some bug that breaks 3rd party apps like Tasker when shutting down wifi (if I use the Wireless Settings of Tasker or SecureSettings most of the times the wifi status hangs in a "shutting down" state forever, until phone hangs or restart by itself)" so I must use the system way.

Anyway I have solved by launching the androd "wifi settings" and then by executing a tasker script with send event to simulate a keypress.
Reply all
Reply to author
Forward
0 new messages