@Override
public void messageArrived(String topic, MqttMessage message) throws Exception {
String str = message.toString();
+ Log.d("CtFwS", "Message(Reset): " + str);
long before;
try {
before = Long.parseLong(message.toString());
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
+
+ private static final String TAG = "CtFwS";
+
private final MainActivityBuildHooks mabh = new MainActivityBuildHooksImpl();
private MainService.LocalBinder mSrvBinder; // set once connection completed
@Override
public void onStart() {
- Log.d("CtFwS", "onStart");
+ Log.d(TAG, "onStart");
super.onStart();
if (mSrvBinder == null) {
@Override
public void onResume() {
- Log.d("CtFwS", "onResume");
+ Log.d(TAG, "onResume");
super.onResume();
if (mSrvBinder != null) {
@Override
protected void onPause() {
- Log.d("CtFwS", "onPause");
+ Log.d(TAG, "onPause");
if (mSrvBinder != null) {
mSrvBinder.getGameState().unregisterObserver(mCdl);
mSrvBinder.unregisterObserver(mSrvObs);
@Override
protected void onStop() {
- Log.d("CtFwS", "onStop");
+ Log.d(TAG, "onStop");
super.onStop();
}
@Override
protected void onDestroy() {
- Log.d("CtFwS", "onDestroy");
+ Log.d(TAG, "onDestroy");
unbindService(ctfwssc);
super.onDestroy();
import android.os.IBinder;
import android.preference.PreferenceManager;
import android.support.v4.app.NotificationCompat;
+import android.util.Log;
import com.acmetensortoys.ctfwstimer.lib.CtFwSGameStateManager;
// and if it's in (or after) the current game.
// Always update the length in case this is a reset to zero.
int s = msgs.size();
+ Log.d("CtFwSNotify", "on msg s=" + s + " lastix=" + lastMsgIx);
if (s > lastMsgIx) {
CtFwSGameStateManager.Msg m = msgs.get(s-1);
+ Log.d("CtFwsNotify", "msg gst=" + game.getStartT() + " when=" + m.when);
if (game.isConfigured() && m.when >= game.getStartT()) {
notifyUserSomehow(NotificationSource.MESG);
lastContextTextSource = LastContentTextSource.MESG;