mirror of
https://github.com/moparisthebest/Yaaic
synced 2025-02-16 23:10:11 -05:00
Make Settings accessible via service
This commit is contained in:
parent
85dc0847e3
commit
be554f726a
@ -27,10 +27,11 @@ import java.util.HashMap;
|
||||
|
||||
import org.yaaic.R;
|
||||
import org.yaaic.Yaaic;
|
||||
import org.yaaic.activity.ServersActivity;
|
||||
import org.yaaic.db.Database;
|
||||
import org.yaaic.model.Broadcast;
|
||||
import org.yaaic.model.Server;
|
||||
import org.yaaic.activity.ServersActivity;
|
||||
import org.yaaic.model.Settings;
|
||||
|
||||
import android.app.Notification;
|
||||
import android.app.NotificationManager;
|
||||
@ -63,6 +64,7 @@ public class IRCService extends Service
|
||||
private Object[] mStartForegroundArgs = new Object[2];
|
||||
private Object[] mStopForegroundArgs = new Object[1];
|
||||
private Notification notification;
|
||||
private Settings settings;
|
||||
|
||||
/**
|
||||
* Create new service
|
||||
@ -73,6 +75,7 @@ public class IRCService extends Service
|
||||
|
||||
this.connections = new HashMap<Integer, IRCConnection>();
|
||||
this.binder = new IRCBinder(this);
|
||||
this.settings = new Settings(getApplicationContext());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -100,6 +103,16 @@ public class IRCService extends Service
|
||||
// Broadcast changed server list
|
||||
sendBroadcast(new Intent(Broadcast.SERVER_UPDATE));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Settings object
|
||||
*
|
||||
* @return the settings helper object
|
||||
*/
|
||||
public Settings getSettings()
|
||||
{
|
||||
return settings;
|
||||
}
|
||||
|
||||
/**
|
||||
* On start (will be called on pre-2.0 platform. On 2.0 or later onStartCommand()
|
||||
|
Loading…
Reference in New Issue
Block a user