7 |
import android.content.Intent; |
import android.content.Intent; |
8 |
import android.location.LocationManager; |
import android.location.LocationManager; |
9 |
import android.net.ConnectivityManager; |
import android.net.ConnectivityManager; |
|
import android.net.NetworkInfo; |
|
10 |
import android.os.Bundle; |
import android.os.Bundle; |
|
import android.os.Handler; |
|
|
import android.os.Message; |
|
11 |
import android.os.PowerManager; |
import android.os.PowerManager; |
12 |
import android.provider.Settings; |
import android.provider.Settings; |
13 |
import android.telephony.TelephonyManager; |
import android.telephony.TelephonyManager; |
40 |
|
|
41 |
PowerManager.WakeLock wakeLock; |
PowerManager.WakeLock wakeLock; |
42 |
|
|
|
SimHandler simHandler = new SimHandler(); |
|
43 |
|
|
44 |
@Override |
@Override |
45 |
public void onAttachedToWindow() { |
public void onAttachedToWindow() { |
142 |
|
|
143 |
} |
} |
144 |
|
|
|
void showMessage(String msg) { |
|
|
AlertDialog.Builder builder = new AlertDialog.Builder(this); |
|
|
builder.setMessage(msg) |
|
|
.setPositiveButton("OK", new DialogInterface.OnClickListener() { |
|
|
public void onClick(DialogInterface dialog, int id) { |
|
|
dialog.dismiss(); |
|
|
} |
|
|
}) |
|
|
.create() |
|
|
.show(); |
|
|
|
|
|
} |
|
145 |
|
|
146 |
@Override |
@Override |
147 |
protected void onStop() { |
protected void onStop() { |
198 |
return super.onMenuItemSelected(featureId, item); |
return super.onMenuItemSelected(featureId, item); |
199 |
} |
} |
200 |
|
|
201 |
|
/*void showMessage(String msg) { |
202 |
|
AlertDialog.Builder builder = new AlertDialog.Builder(this); |
203 |
|
builder.setMessage(msg) |
204 |
|
.setPositiveButton("OK", new DialogInterface.OnClickListener() { |
205 |
|
public void onClick(DialogInterface dialog, int id) { |
206 |
|
dialog.dismiss(); |
207 |
|
} |
208 |
|
}) |
209 |
|
.create() |
210 |
|
.show(); |
211 |
|
|
212 |
|
}*/ |
213 |
|
|
214 |
|
/* Proof-of-concept code |
215 |
Handler timeoutHandler = new Handler() { |
Handler timeoutHandler = new Handler() { |
216 |
@Override |
@Override |
217 |
public void handleMessage(Message msg) { |
public void handleMessage(Message msg) { |
221 |
|
|
222 |
}; |
}; |
223 |
|
|
|
|
|
|
|
|
224 |
|
|
225 |
|
|
226 |
class SimHandler extends Handler { |
class SimHandler extends Handler { |
243 |
testNetwork(); |
testNetwork(); |
244 |
} |
} |
245 |
}; |
}; |
246 |
|
*/ |
247 |
|
|
248 |
} |
} |