Note that there are some explanatory texts on larger screens.

plurals
  1. POContent provider - multiple where parameters
    primarykey
    data
    text
    <p>I am a newbie with content providers and I have been referring to <a href="http://www.nofluffjuststuff.com/blog/vladimir_vivien/2011/11/a_pattern_for_creating_custom_android_content_providers" rel="nofollow">this</a> document in order to understand and create a custom content provider.</p> <p>I have paths like this in the content descriptor class for content provider:</p> <pre><code>public static final String PATH = "tbl_reco_index_contents"; public static final String PATH_FOR_ID = "tbl_reco_index_contents/*"; </code></pre> <p>With the below code, I am able to fetch the data from the columns which I need, without any issues:</p> <pre><code> public static final String AUTHORITY = "com.nyk.launcherprovider"; private static final Uri BASE_URI = Uri.parse("content://" + AUTHORITY); public static final String PATH = "tbl_reco_index_contents"; public static final Uri CONTENT_URI = BASE_URI.buildUpon().appendPath(PATH).build(); cur = this.getContentResolver().query(CONTENT_URI, new String[]{ "reco_index_content_name", "reco_index_content_url" }, null, null, null); cur.moveToFirst(); for(int i=0;i&lt;cur.getCount();i++){ System.out.println("Name is:"+cur.getString(10)); System.out.println("URL is:"+cur.getString(11)); cur.moveToNext(); } </code></pre> <p>I do not know, how I can fetch data using a where condition here. ie; if I need to add a condition like <code>WHERE user_profile_number = 2 and pkg_name = 'abc'</code> , how do I handle that along with the code above. </p> <p>Any help is much appreciated.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload