Condividi tramite


Service.SetForeground(Boolean) Method

Definition

This member is deprecated.

[Android.Runtime.Register("setForeground", "(Z)V", "")]
public void SetForeground (bool isForeground);
[<Android.Runtime.Register("setForeground", "(Z)V", "")>]
member this.SetForeground : bool -> unit

Parameters

isForeground
Boolean
Attributes

Remarks

This member is deprecated. This is a now a no-op, use #startForeground(int, Notification) instead. This method has been turned into a no-op rather than simply being deprecated because analysis of numerous poorly behaving devices has shown that increasingly often the trouble is being caused in part by applications that are abusing it. Thus, given a choice between introducing problems in existing applications using this API (by allowing them to be killed when they would like to avoid it), vs allowing the performance of the entire system to be decreased, this method was deemed less important.

Java documentation for android.app.Service.setForeground(boolean).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to