Partager via


ActivityManager.GetHistoricalProcessExitReasons(String, Int32, Int32) Method

Definition

Return a list of ApplicationExitInfo records containing the reasons for the most recent app deaths.

[Android.Runtime.Register("getHistoricalProcessExitReasons", "(Ljava/lang/String;II)Ljava/util/List;", "GetGetHistoricalProcessExitReasons_Ljava_lang_String_IIHandler", ApiSince=30)]
public virtual System.Collections.Generic.IList<Android.App.ApplicationExitInfo> GetHistoricalProcessExitReasons (string? packageName, int pid, int maxNum);
[<Android.Runtime.Register("getHistoricalProcessExitReasons", "(Ljava/lang/String;II)Ljava/util/List;", "GetGetHistoricalProcessExitReasons_Ljava_lang_String_IIHandler", ApiSince=30)>]
abstract member GetHistoricalProcessExitReasons : string * int * int -> System.Collections.Generic.IList<Android.App.ApplicationExitInfo>
override this.GetHistoricalProcessExitReasons : string * int * int -> System.Collections.Generic.IList<Android.App.ApplicationExitInfo>

Parameters

packageName
String

Optional, a null value means match all packages belonging to the caller's UID. If this package belongs to another UID, you must hold android.Manifest.permission#DUMP in order to retrieve it.

pid
Int32

A process ID that used to belong to this package but died later; a value of 0 means to ignore this parameter and return all matching records.

maxNum
Int32

The maximum number of results to be returned; a value of 0 means to ignore this parameter and return all matching records

Returns

a list of ApplicationExitInfo records matching the criteria, sorted in the order from most recent to least recent.

Attributes

Remarks

Return a list of ApplicationExitInfo records containing the reasons for the most recent app deaths.

<p class="note"> Note: System stores this historical information in a ring buffer and only the most recent records will be returned. </p>

<p class="note"> Note: In the case that this application was bound to an external service with flag android.content.Context#BIND_EXTERNAL_SERVICE, the process of that external service will be included in this package's exit info. </p>

Java documentation for android.app.ActivityManager.getHistoricalProcessExitReasons(java.lang.String, int, int).

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