Created
May 31, 2012 00:25
-
-
Save levinotik/2839793 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<service android:name="com.me.services.MusicService"> | |
<intent-filter> | |
<action android:name="com.me.action.NOTIFY_WIFI_CHANGE"/> | |
</intent-filter> | |
</service> | |
public void onReceive(Context context, Intent intent) { | |
Intent notifyIntent = new Intent(MusicService.ACTION_NOTIFY_WIFI_CHANGE); | |
notifyIntent.putExtra("have_connection", mHaveConnection); | |
context.startService(intent); | |
} | |
and in my MusicService: | |
public static final String ACTION_NOTIFY_WIFI_CHANGE = "com.me.action.NOTIFY_WIFI_CHANGE; | |
.... | |
onStartCommand() { ... else if(action.equals(ACTION_NOTIFY_WIFI_CHANGE))handleWifiChange(intent);} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment