Click here to Skip to main content
15,886,664 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
I want to trace my device setting changes.for example
When user try to turn on or off wifi or change display setting
Is there any class or api for do this android?
Posted

1 solution

You can try registering a receiver for the event, call something like this in your Activity's onCreate;
Java
registerReceiver(myStateChangeReceiver, new IntentFilter(WifiManager.WIFI_STATE_CHANGED_ACTION));


Where myStateChangeReceiver is a BroadcastReceiver. You might need to enable some permissions for this.

Hope this helps,
Fredrik
 
Share this answer
 
Comments
AminMhmdi 9-Dec-14 9:40am    
tnx but i want to do this as service
do you have full source code for this??
Fredrik Bornander 9-Dec-14 9:49am    
It doesn't matter that much if it's a service or a "normal" activity, you listen to broadcast events the same way, more or less.

If you want someone to do this for you I think you're better off here; http://www.rent-acoder.com/

This Q/A forum is for questions, not for getting whole applications written.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900