Note that there are some explanatory texts on larger screens.

plurals
  1. POWhat is wrong with my ContentProvider in Android 4.3?
    primarykey
    data
    text
    <p>My app works just fine with any Android version before <code>4.3</code>. I mean when I input a word into <code>edWord</code> (EditText field), a list of similarly-spelled words will appear in the list view.</p> <p>But in <code>Android 4.3</code>, it always returns <code>null</code>, claiming that app_ContentProvider cannot find the supported <code>uri</code>.</p> <p>I use the following code to show the word list:</p> <pre><code>public void showWordlist() { edWord.setEnabled(true); String word = edWord.getText().toString(); Uri uri = Uri.parse("content://doyle.app_name.app_ContentProvider/dict/" + mDBFile.fileName + "/list/" + word); edWord.requestFocus(); try { Cursor result = getContentResolver().query(uri,null,null,null,null); Log.i(MAIN_TAG, "Found word = " + result); //I think the problem lies somewhere here because //the 'result' is always 'null' (see the above log.i) if (result != null) { int countRow=result.getCount(); Log.i(MAIN_TAG, "countRow = " + countRow); mLSTCurrentWord.clear(); //mLSTCurrentContent.clear(); mLSTCurrentWordId.clear(); mAdapter.clear(); if (countRow &gt;= 1) { int indexWordColumn = result.getColumnIndex("word"); int indexIdColumn = result.getColumnIndex("id"); result.moveToFirst(); String strWord; int intId; int i = 0; do { strWord = Utility.decodeContent(result.getString(indexWordColumn)); intId = result.getInt(indexIdColumn); mLSTCurrentWord.add(i,strWord); mLSTCurrentWordId.add(i,intId); //mLSTCurrentContent.add(i,strContent); mAdapter.add(strWord); i++; } while (result.moveToNext()); } result.close(); } lstWord.setAdapter(mAdapter); } catch (Exception ex) { Log.e(MAIN_TAG, "Error = " + ex.toString()); } edWord.setEnabled(true); } </code></pre> <p>And here is my <a href="https://dl.dropboxusercontent.com/u/15034088/Others/Temps/AppProvider.java" rel="nofollow">app_ContentProvider</a>.</p> <p>I have no idea whether there are any changes in <code>Android 4.3</code> that stop my app from functioning normally.</p> <p>Regarding my code lines above, can you please tell me what the problem might be? Thanks a lot.</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.
 

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