mirror of
https://github.com/moparisthebest/Yaaic
synced 2025-02-21 05:11:47 -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.R;
|
||||||
import org.yaaic.Yaaic;
|
import org.yaaic.Yaaic;
|
||||||
|
import org.yaaic.activity.ServersActivity;
|
||||||
import org.yaaic.db.Database;
|
import org.yaaic.db.Database;
|
||||||
import org.yaaic.model.Broadcast;
|
import org.yaaic.model.Broadcast;
|
||||||
import org.yaaic.model.Server;
|
import org.yaaic.model.Server;
|
||||||
import org.yaaic.activity.ServersActivity;
|
import org.yaaic.model.Settings;
|
||||||
|
|
||||||
import android.app.Notification;
|
import android.app.Notification;
|
||||||
import android.app.NotificationManager;
|
import android.app.NotificationManager;
|
||||||
@ -63,6 +64,7 @@ public class IRCService extends Service
|
|||||||
private Object[] mStartForegroundArgs = new Object[2];
|
private Object[] mStartForegroundArgs = new Object[2];
|
||||||
private Object[] mStopForegroundArgs = new Object[1];
|
private Object[] mStopForegroundArgs = new Object[1];
|
||||||
private Notification notification;
|
private Notification notification;
|
||||||
|
private Settings settings;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create new service
|
* Create new service
|
||||||
@ -73,6 +75,7 @@ public class IRCService extends Service
|
|||||||
|
|
||||||
this.connections = new HashMap<Integer, IRCConnection>();
|
this.connections = new HashMap<Integer, IRCConnection>();
|
||||||
this.binder = new IRCBinder(this);
|
this.binder = new IRCBinder(this);
|
||||||
|
this.settings = new Settings(getApplicationContext());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -101,6 +104,16 @@ public class IRCService extends Service
|
|||||||
sendBroadcast(new Intent(Broadcast.SERVER_UPDATE));
|
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()
|
* On start (will be called on pre-2.0 platform. On 2.0 or later onStartCommand()
|
||||||
* will be called)
|
* will be called)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user