Use of an integer code in URIMatcher class in Android -


according android documentation, have provide int code every uri match.

adduri(string authority, string path, int code) 

and documentation explains:

add uri match, , code return when uri matched.

what role "code" play?

i understand in case of urimatcher.no_match returns -1, invalid matches!, other codes 1, 20, 14 etc?

for example,

private static final int people = 1; private static final int people_id = 2; private static final int people_phones = 3; private static final int people_phones_id = 4; private static final int people_contactmethods = 7; 

or private static final int deleted_people = 20;

the above code has been taken here.

this code returned urimatcher.match(). can use switch statement take action based on type of uri matched. here example own project.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -