Share via


Process.DestroyForcibly Method

Definition

Kills the subprocess.

[Android.Runtime.Register("destroyForcibly", "()Ljava/lang/Process;", "GetDestroyForciblyHandler", ApiSince=26)]
public virtual Java.Lang.Process? DestroyForcibly ();
[<Android.Runtime.Register("destroyForcibly", "()Ljava/lang/Process;", "GetDestroyForciblyHandler", ApiSince=26)>]
abstract member DestroyForcibly : unit -> Java.Lang.Process
override this.DestroyForcibly : unit -> Java.Lang.Process

Returns

the Process object representing the subprocess to be forcibly destroyed.

Attributes

Remarks

Kills the subprocess. The subprocess represented by this Process object is forcibly terminated.

The default implementation of this method invokes #destroy and so may not forcibly terminate the process. Concrete implementations of this class are strongly encouraged to override this method with a compliant implementation. Invoking this method on Process objects returned by ProcessBuilder#start and Runtime#exec will forcibly terminate the process.

Note: The subprocess may not terminate immediately. i.e. isAlive() may return true for a brief period after destroyForcibly() is called. This method may be chained to waitFor() if needed.

Added in 1.8.

Java documentation for java.lang.Process.destroyForcibly().

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