언어

Service.StopForeground 메서드

정의

오버로드

속성 Description
StopForeground(StopForegroundFlags)

더 많은 메모리가 필요한 경우 이 서비스를 포그라운드 상태에서 제거하여 종료할 수 있습니다.

StopForeground(Boolean)

레거시 버전의 #stopForeground(int).

StopForeground(StopForegroundFlags)

더 많은 메모리가 필요한 경우 이 서비스를 포그라운드 상태에서 제거하여 종료할 수 있습니다.

[Android.Runtime.Register("stopForeground", "(I)V", "", ApiSince=24)]
public void StopForeground(Android.App.StopForegroundFlags flags);
[<Android.Runtime.Register("stopForeground", "(I)V", "", ApiSince=24)>]
member this.StopForeground : Android.App.StopForegroundFlags -> unit

매개 변수

특성

설명

더 많은 메모리가 필요한 경우 이 서비스를 포그라운드 상태에서 제거하여 종료할 수 있습니다. 이렇게 하면 서비스가 실행되지 않고(stopSelf() 또는 관련 메서드를 사용하기 때문에 포그라운드 상태에서 벗어나기만 하면 됩니다. STOP_FOREGROUND_REMOVE 제공된 경우 서비스의 연결된 알림이 즉시 취소됩니다.

STOP_FOREGROUND_DETACH 제공된 경우 알림과 서비스의 연결이 끊어집니다. 포그라운드 서비스 알림 지연 정책으로 인해 알림이 아직 표시되지 않은 경우 stopForeground(STOP_FOREGROUND_DETACH)가 호출될 때 즉시 게시됩니다. 모든 경우에 이 서비스가 완전히 중지되고 제거된 후에도 알림이 표시됩니다.

0이 인수로 전달되면 결과는 Android L 이전에 정의된 레거시 동작이 됩니다. 알림은 서비스가 완전히 중지될 때까지 게시되며, 이때 자동으로 취소됩니다.

참고 항목:

에 대한 android.app.Service.stopForegroundAndroid 참조

이 페이지의 일부는 만들고 공유한 작업을 기반으로 하며 에 설명된 조건에 따라 사용됩니다.

적용 대상

StopForeground(Boolean)

레거시 버전의 #stopForeground(int).

[Android.Runtime.Register("stopForeground", "(Z)V", "")]
public void StopForeground(bool removeNotification);
[<Android.Runtime.Register("stopForeground", "(Z)V", "")>]
member this.StopForeground : bool -> unit

매개 변수

removeNotification
Boolean

true이 #STOP_FOREGROUND_REMOVE 면 선택기가 전달되고 #stopForeground(int), 그렇지 않으면 #STOP_FOREGROUND_LEGACY 전달됩니다.

특성

설명

이 메서드는 API 수준 33에서 더 이상 사용되지 않습니다. stopForeground(int)를 호출하고 STOP_FOREGROUND_REMOVE 또는 STOP_FOREGROUND_DETACH 명시적으로 전달합니다.

stopForeground(int)의 레거시 버전입니다.

참고 항목:

에 대한 android.app.Service.stopForegroundAndroid 참조

이 페이지의 일부는 만들고 공유한 작업을 기반으로 하며 에 설명된 조건에 따라 사용됩니다.

적용 대상