에이치의 모바일 앱 개발
restart application version 1.0.1 본문
/**
* Created by lsh on 2016-08-04. * version 1.0.1
*/
public class ReStartApp {
// context <- ApplicationContext
public ReStartApp(Context context, Class restartActivity) {
// here I do logging of exception to a db
PendingIntent myActivity = PendingIntent
.getActivity(context,
192837,
new Intent(
context,
restartActivity),
PendingIntent.FLAG_ONE_SHOT);
AlarmManager alarmManager;
alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
alarmManager.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, 15000, myActivity);
}
}
'Android > Android 개발 소스' 카테고리의 다른 글
화면 가로 세로 설정하기 (0) | 2017.12.23 |
---|---|
다른 앱 연결 1.0.2 <방법 1> (0) | 2017.12.23 |
error message dialog activity version 1.0.1 (0) | 2017.12.23 |
uncaughtexception version 1.0.2 (0) | 2017.12.23 |
File & I/O (0) | 2017.12.23 |
Comments