Added in API level 29

DnsResolver.Callback


public static interface DnsResolver.Callback

android.net.DnsResolver.Callback<T>


Base interface for answer callbacks

Summary

Public methods

abstract void onAnswer(T answer, int rcode)

Success response to query() or rawQuery().

abstract void onError(DnsResolver.DnsException error)

Error response to query() or rawQuery().

Public methods

onAnswer

Added in API level 29
public abstract void onAnswer (T answer, 
                int rcode)

Success response to query() or rawQuery(). Invoked when the answer to a query was successfully parsed.

Parameters
answer T: answer to the query. This value cannot be null.

rcode int: The response code in the DNS response.

See also:

onError

Added in API level 29
public abstract void onError (DnsResolver.DnsException error)

Error response to query() or rawQuery(). Invoked when there is no valid answer to query() rawQuery().

Parameters
error DnsResolver.DnsException: a DnsException object with additional detail regarding the failure This value cannot be null.