콘텐츠로 이동

Android

Hive SDK를 설치 후 수행하는 작업을 안내합니다.

Android Activity Lifecycle 설정

Hive SDK 설치 후 Android 활동 수명 주기를 설정합니다. MainActivity에서 Android 활동 수명 주기에 맞춰서 아래 코드를 호출합니다.

@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
   HiveActivity.onCreate(this, savedInstanceState);
}
@Override
protected void onStart() {
  super.onStart();
   HiveActivity.onStart(this);
}
@Override
protected void onRestart() {
  super.onRestart();
   HiveActivity.onRestart(this);
}
@Override
protected void onResume() {
  super.onResume();
   HiveActivity.onResume(this);
}
@Override
protected void onPause() {
  HiveActivity.onPause(this);
   super.onPause();
}
@Override
protected void onStop() {
  HiveActivity.onStop(this);
   super.onStop();
}
@Override
protected void onDestroy() {
  HiveActivity.onDestroy(this);
   super.onDestroy();
}
@Override
public void onWindowFocusChanged(boolean hasFocus) {
  super.onWindowFocusChanged(hasFocus);
   HiveActivity.onWindowFocusChanged(this, hasFocus);
}
@Override
protected void onNewIntent(Intent intent) {
  super.onNewIntent(intent);
   HiveActivity.onNewIntent(this, intent);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
  super.onActivityResult(requestCode, resultCode, data);
   HiveActivity.onActivityResult(this, requestCode, resultCode, data);
}
// Android SDK 6.0 (android-23) API over
@TargetApi(23)
@Override
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
  super.onRequestPermissionsResult(requestCode, permissions, grantResults);
   HiveActivity.onRequestPermissionsResult(this, requestCode, permissions, grantResults);
}