Page 917 - 3-2
P. 917
Toast.LENGTH_SHORT).show();
Log.d(this.getClass().getName(),
"Service6 Success");
}
}).create().show();
}
}else
{
if(MyService.textAl.equals(" 안전")){
alFlag=0;
}
}
//Log.d(this.getClass().getName(), "All Service Success");
}
catch (Exception e)
{
e.printStackTrace();
Log.d(this.getClass().getName(), "Service Fail");
}
}
});
}
};
timer.schedule(timerTask, 0, 10);
//0 초 이후 시작하여 1s 마다 한번씩 timeTask 의 run 을 작동시킨다.
}
}
* activity_main.xml 코드
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="example.com.myapplication.MainActivity"
android:background="@drawable/bg_main">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
- 917 -