Rev 18 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 18 | Rev 20 | ||
---|---|---|---|
Line 12... | Line 12... | ||
12 | *
|
12 | *
|
13 | * @author Thomas 'PointedEars' Lahn
|
13 | * @author Thomas 'PointedEars' Lahn
|
14 | */
|
14 | */
|
15 | public class UpdateService extends Service |
15 | public class UpdateService extends Service |
16 | {
|
16 | {
|
17 | // private Timer myTimer = null;
|
- | |
18 | // private final BroadcastTimerTask sendTime = null;
|
- | |
19 | private static CurrenciesActivity activityContext; |
- | |
20 | private ConverterThread updateThread; |
17 | private ConverterThread updateThread; |
21 | private Handler handler; |
18 | private Handler handler; |
22 | private RatesUpdater ratesUpdater; |
19 | private RatesUpdater ratesUpdater; |
23 | 20 | ||
24 | public static final String ACTION_UPDATE = |
21 | public static final String ACTION_UPDATE = |
Line 98... | Line 95... | ||
98 | String action = intent.getAction(); |
95 | String action = intent.getAction(); |
99 | if (UpdateService.ACTION_UPDATE.equals(action)) |
96 | if (UpdateService.ACTION_UPDATE.equals(action)) |
100 | {
|
97 | {
|
101 | if (this.updateThread == null) |
98 | if (this.updateThread == null) |
102 | {
|
99 | {
|
103 | this.ratesUpdater = |
- | |
104 | new RatesUpdater(UpdateService.activityContext, this); |
100 | this.ratesUpdater = new RatesUpdater(this); |
105 | this.updateThread = |
101 | this.updateThread = |
106 | new ConverterThread(this.ratesUpdater, this.handler); |
102 | new ConverterThread(this.ratesUpdater, this.handler); |
107 | this.ratesUpdater.setUpdateThread(this.updateThread); |
103 | this.ratesUpdater.setUpdateThread(this.updateThread); |
108 | }
|
104 | }
|
109 | 105 | ||
Line 136... | Line 132... | ||
136 | // // this.editValue1.setText("Bereits gestoppt -> Warten auf Start");
|
132 | // // this.editValue1.setText("Bereits gestoppt -> Warten auf Start");
|
137 | // }
|
133 | // }
|
138 | // return true;
|
134 | // return true;
|
139 | }
|
135 | }
|
140 | }
|
136 | }
|
141 | - | ||
142 | /**
|
- | |
143 | * @param activityContext
|
- | |
144 | * the activityContext to set
|
- | |
145 | */
|
- | |
146 | public static void setActivityContext(CurrenciesActivity activityContext) |
- | |
147 | {
|
- | |
148 | UpdateService.activityContext = activityContext; |
- | |
149 | }
|
- | |
150 | }
|
137 | }
|