Note that there are some explanatory texts on larger screens.

plurals
  1. PORetrieve value from sql database
    primarykey
    data
    text
    <p>Im trying to retrieve the value from the database file for a string, here is the on create method:</p> <pre><code>@Override protected void onCreate(Bundle savedInstanceState) { mImage= (NotesDbAdapter.KEY_IMAGE); Log.v("IMAGE PATH====&gt;&gt;&gt;&gt; ",mImage);} </code></pre> <p>However log is showing the value retrieved is the default value, i.e image and it is not setting mImage to the value in the database.</p> <p>This is the imagepath stored in the <strong>KEY_IMAGE</strong> db:</p> <blockquote> <p>/storage/emulated/0/Download/Black-Wallpapers-Desktop-Windows-7.jpg</p> </blockquote> <p>This is the log file:</p> <blockquote> <p>08-04 16:16:13.355: E/BitmapFactory(26933): Unable to decode stream: java.io.FileNotFoundException: /image: open failed: ENOENT (No such file or directory)</p> </blockquote> <p><strong>UPDATE</strong></p> <pre><code>private void populateFields() { if (mRowId != null) { Cursor note = mDbHelper.fetchNote(mRowId); startManagingCursor(note); mTitleText.setText(note.getString( note.getColumnIndexOrThrow(NotesDbAdapter.KEY_TITLE))); mBodyText.setText(note.getString( note.getColumnIndexOrThrow(NotesDbAdapter.KEY_BODY))); mColor =(note.getString( note.getColumnIndexOrThrow(NotesDbAdapter.KEY_COLOR))); mDate =(DateUtils.formatDateTime(this, System.currentTimeMillis(), DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_NUMERIC_DATE )); mImage =(note.getString( note.getColumnIndexOrThrow(NotesDbAdapter.KEY_IMAGE))); } } </code></pre> <p>The other fields work fine but the mImage doesnt.</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