# ResolveInfo.DisplayNameComparator

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Ctors](https://developer.android.com/reference/android/content/pm/ResolveInfo.DisplayNameComparator#pubctors)\|[Methods](https://developer.android.com/reference/android/content/pm/ResolveInfo.DisplayNameComparator#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/content/pm/ResolveInfo.DisplayNameComparator#inhmethods)  

# ResolveInfo.DisplayNameComparator

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/content/pm/ResolveInfo.DisplayNameComparator "View this page in Kotlin")\|Java

`
public
static


class
ResolveInfo.DisplayNameComparator
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


implements

`[Comparator](https://developer.android.com/reference/java/util/Comparator)`<`[ResolveInfo](https://developer.android.com/reference/android/content/pm/ResolveInfo)`>


`

|---|------------------------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.content.pm.ResolveInfo.DisplayNameComparator |

<br />

*** ** * ** ***

## Summary

|                                                                                                                                  ### Public constructors                                                                                                                                  ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[DisplayNameComparator](https://developer.android.com/reference/android/content/pm/ResolveInfo.DisplayNameComparator#DisplayNameComparator(android.content.pm.PackageManager))`(`[PackageManager](https://developer.android.com/reference/android/content/pm/PackageManager)` pm) ` |

|                                                                                                                                                                                     ### Public methods                                                                                                                                                                                      ||
|--------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` final int` | ` `[compare](https://developer.android.com/reference/android/content/pm/ResolveInfo.DisplayNameComparator#compare(android.content.pm.ResolveInfo,%20android.content.pm.ResolveInfo))`(`[ResolveInfo](https://developer.android.com/reference/android/content/pm/ResolveInfo)` a, `[ResolveInfo](https://developer.android.com/reference/android/content/pm/ResolveInfo)` b) ` |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](https://developer.android.com/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                          | | ` final `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed.                   | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*.                                                                                             | ||
| From interface` `[java.util.Comparator](https://developer.android.com/reference/java/util/Comparator)` ` |----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract int`                                                                                                                                                                                                                                                                        | ` `[compare](https://developer.android.com/reference/java/util/Comparator#compare(T,%20T))`(`[ResolveInfo](https://developer.android.com/reference/android/content/pm/ResolveInfo)` o1, `[ResolveInfo](https://developer.android.com/reference/android/content/pm/ResolveInfo)` o2) ` Compares its two arguments for order.                                                                                                                                                                                                                                                                                                                       | | ` static <T, U> `[Comparator](https://developer.android.com/reference/java/util/Comparator)`<`[ResolveInfo](https://developer.android.com/reference/android/content/pm/ResolveInfo)`>`                                                                                                 | ` `[comparing](https://developer.android.com/reference/java/util/Comparator#comparing(java.util.function.Function<?%20super%20T,?%20extends%20U>,%20java.util.Comparator<?%20super%20U>))`(`[Function](https://developer.android.com/reference/java/util/function/Function)`<? super T, ? extends U> keyExtractor, `[Comparator](https://developer.android.com/reference/java/util/Comparator)`<? super U> keyComparator) ` Accepts a function that extracts a sort key from a type`T`, and returns a`Comparator<T>`that compares by that sort key using the specified[Comparator](https://developer.android.com/reference/java/util/Comparator). | | ` static <T, U extends `[Comparable](https://developer.android.com/reference/java/lang/Comparable)`<? super U>> `[Comparator](https://developer.android.com/reference/java/util/Comparator)`<`[ResolveInfo](https://developer.android.com/reference/android/content/pm/ResolveInfo)`>` | ` `[comparing](https://developer.android.com/reference/java/util/Comparator#comparing(java.util.function.Function<?%20super%20T,?%20extends%20U>))`(`[Function](https://developer.android.com/reference/java/util/function/Function)`<? super T, ? extends U> keyExtractor) ` Accepts a function that extracts a[Comparable](https://developer.android.com/reference/java/lang/Comparable)sort key from a type`T`, and returns a`Comparator<T>`that compares by that sort key.                                                                                                                                                                    | | ` static <T> `[Comparator](https://developer.android.com/reference/java/util/Comparator)`<`[ResolveInfo](https://developer.android.com/reference/android/content/pm/ResolveInfo)`>`                                                                                                    | ` `[comparingDouble](https://developer.android.com/reference/java/util/Comparator#comparingDouble(java.util.function.ToDoubleFunction<?%20super%20T>))`(`[ToDoubleFunction](https://developer.android.com/reference/java/util/function/ToDoubleFunction)`<? super T> keyExtractor) ` Accepts a function that extracts a`double`sort key from a type`T`, and returns a`Comparator<T>`that compares by that sort key.                                                                                                                                                                                                                               | | ` static <T> `[Comparator](https://developer.android.com/reference/java/util/Comparator)`<`[ResolveInfo](https://developer.android.com/reference/android/content/pm/ResolveInfo)`>`                                                                                                    | ` `[comparingInt](https://developer.android.com/reference/java/util/Comparator#comparingInt(java.util.function.ToIntFunction<?%20super%20T>))`(`[ToIntFunction](https://developer.android.com/reference/java/util/function/ToIntFunction)`<? super T> keyExtractor) ` Accepts a function that extracts an`int`sort key from a type`T`, and returns a`Comparator<T>`that compares by that sort key.                                                                                                                                                                                                                                                | | ` static <T> `[Comparator](https://developer.android.com/reference/java/util/Comparator)`<`[ResolveInfo](https://developer.android.com/reference/android/content/pm/ResolveInfo)`>`                                                                                                    | ` `[comparingLong](https://developer.android.com/reference/java/util/Comparator#comparingLong(java.util.function.ToLongFunction<?%20super%20T>))`(`[ToLongFunction](https://developer.android.com/reference/java/util/function/ToLongFunction)`<? super T> keyExtractor) ` Accepts a function that extracts a`long`sort key from a type`T`, and returns a`Comparator<T>`that compares by that sort key.                                                                                                                                                                                                                                           | | ` abstract boolean`                                                                                                                                                                                                                                                                    | ` `[equals](https://developer.android.com/reference/java/util/Comparator#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this comparator.                                                                                                                                                                                                                                                                                                                                                                                                | | ` static <T extends `[Comparable](https://developer.android.com/reference/java/lang/Comparable)`<? super T>> `[Comparator](https://developer.android.com/reference/java/util/Comparator)`<T>`                                                                                          | ` `[naturalOrder](https://developer.android.com/reference/java/util/Comparator#naturalOrder())`() ` Returns a comparator that compares[Comparable](https://developer.android.com/reference/java/lang/Comparable)objects in natural order.                                                                                                                                                                                                                                                                                                                                                                                                         | | ` static <T> `[Comparator](https://developer.android.com/reference/java/util/Comparator)`<`[ResolveInfo](https://developer.android.com/reference/android/content/pm/ResolveInfo)`>`                                                                                                    | ` `[nullsFirst](https://developer.android.com/reference/java/util/Comparator#nullsFirst(java.util.Comparator<?%20super%20T>))`(`[Comparator](https://developer.android.com/reference/java/util/Comparator)`<? super T> comparator) ` Returns a null-friendly comparator that considers`null`to be less than non-null.                                                                                                                                                                                                                                                                                                                             | | ` static <T> `[Comparator](https://developer.android.com/reference/java/util/Comparator)`<`[ResolveInfo](https://developer.android.com/reference/android/content/pm/ResolveInfo)`>`                                                                                                    | ` `[nullsLast](https://developer.android.com/reference/java/util/Comparator#nullsLast(java.util.Comparator<?%20super%20T>))`(`[Comparator](https://developer.android.com/reference/java/util/Comparator)`<? super T> comparator) ` Returns a null-friendly comparator that considers`null`to be greater than non-null.                                                                                                                                                                                                                                                                                                                            | | ` static <T extends `[Comparable](https://developer.android.com/reference/java/lang/Comparable)`<? super T>> `[Comparator](https://developer.android.com/reference/java/util/Comparator)`<T>`                                                                                          | ` `[reverseOrder](https://developer.android.com/reference/java/util/Comparator#reverseOrder())`() ` Returns a comparator that imposes the reverse of the*natural ordering*.                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | | ` default `[Comparator](https://developer.android.com/reference/java/util/Comparator)`<`[ResolveInfo](https://developer.android.com/reference/android/content/pm/ResolveInfo)`>`                                                                                                       | ` `[reversed](https://developer.android.com/reference/java/util/Comparator#reversed())`() ` Returns a comparator that imposes the reverse ordering of this comparator.                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | | ` default <U extends `[Comparable](https://developer.android.com/reference/java/lang/Comparable)`<? super U>> `[Comparator](https://developer.android.com/reference/java/util/Comparator)`<`[ResolveInfo](https://developer.android.com/reference/android/content/pm/ResolveInfo)`>`   | ` `[thenComparing](https://developer.android.com/reference/java/util/Comparator#thenComparing(java.util.function.Function<?%20super%20T,?%20extends%20U>))`(`[Function](https://developer.android.com/reference/java/util/function/Function)`<? super T, ? extends U> keyExtractor) ` Returns a lexicographic-order comparator with a function that extracts a`Comparable`sort key.                                                                                                                                                                                                                                                               | | ` default <U> `[Comparator](https://developer.android.com/reference/java/util/Comparator)`<`[ResolveInfo](https://developer.android.com/reference/android/content/pm/ResolveInfo)`>`                                                                                                   | ` `[thenComparing](https://developer.android.com/reference/java/util/Comparator#thenComparing(java.util.function.Function<?%20super%20T,?%20extends%20U>,%20java.util.Comparator<?%20super%20U>))`(`[Function](https://developer.android.com/reference/java/util/function/Function)`<? super T, ? extends U> keyExtractor, `[Comparator](https://developer.android.com/reference/java/util/Comparator)`<? super U> keyComparator) ` Returns a lexicographic-order comparator with a function that extracts a key to be compared with the given`Comparator`.                                                                                       | | ` default `[Comparator](https://developer.android.com/reference/java/util/Comparator)`<`[ResolveInfo](https://developer.android.com/reference/android/content/pm/ResolveInfo)`>`                                                                                                       | ` `[thenComparing](https://developer.android.com/reference/java/util/Comparator#thenComparing(java.util.Comparator<?%20super%20T>))`(`[Comparator](https://developer.android.com/reference/java/util/Comparator)`<? super T> other) ` Returns a lexicographic-order comparator with another comparator.                                                                                                                                                                                                                                                                                                                                           | | ` default `[Comparator](https://developer.android.com/reference/java/util/Comparator)`<`[ResolveInfo](https://developer.android.com/reference/android/content/pm/ResolveInfo)`>`                                                                                                       | ` `[thenComparingDouble](https://developer.android.com/reference/java/util/Comparator#thenComparingDouble(java.util.function.ToDoubleFunction<?%20super%20T>))`(`[ToDoubleFunction](https://developer.android.com/reference/java/util/function/ToDoubleFunction)`<? super T> keyExtractor) ` Returns a lexicographic-order comparator with a function that extracts a`double`sort key.                                                                                                                                                                                                                                                            | | ` default `[Comparator](https://developer.android.com/reference/java/util/Comparator)`<`[ResolveInfo](https://developer.android.com/reference/android/content/pm/ResolveInfo)`>`                                                                                                       | ` `[thenComparingInt](https://developer.android.com/reference/java/util/Comparator#thenComparingInt(java.util.function.ToIntFunction<?%20super%20T>))`(`[ToIntFunction](https://developer.android.com/reference/java/util/function/ToIntFunction)`<? super T> keyExtractor) ` Returns a lexicographic-order comparator with a function that extracts an`int`sort key.                                                                                                                                                                                                                                                                             | | ` default `[Comparator](https://developer.android.com/reference/java/util/Comparator)`<`[ResolveInfo](https://developer.android.com/reference/android/content/pm/ResolveInfo)`>`                                                                                                       | ` `[thenComparingLong](https://developer.android.com/reference/java/util/Comparator#thenComparingLong(java.util.function.ToLongFunction<?%20super%20T>))`(`[ToLongFunction](https://developer.android.com/reference/java/util/function/ToLongFunction)`<? super T> keyExtractor) ` Returns a lexicographic-order comparator with a function that extracts a`long`sort key.                                                                                                                                                                                                                                                                        | ||

## Public constructors

### DisplayNameComparator

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public DisplayNameComparator (PackageManager pm)
```

<br />

<br />

|          Parameters           ||
|------|-------------------------|
| `pm` | `PackageManager` <br /> |

## Public methods

### compare

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final int compare (ResolveInfo a, 
                ResolveInfo b)
```

<br />

<br />

|        Parameters         ||
|-----|----------------------|
| `a` | `ResolveInfo` <br /> |
| `b` | `ResolveInfo` <br /> |

|    Returns    ||
|-------|--------|
| `int` | <br /> |