Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <pre><code> public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) { Intent summaryIntent = new Intent(DocumentListActivity.this, ViewDocumentActivity.class); Cursor c = (Cursor)parent.getItemAtPosition(position); summaryIntent.putExtra("SummTopic", c.getString(c.getColumnIndex(SQLiteAdapter.KEY_CONTENT))); startActivity(summaryIntent); } </code></pre> <p>or you can pass <code>id</code> (<code>summaryIntent.putExtra("SummTopicId", id);</code>) of this row and "ask db" in next Activity for Topic with this id</p> <p>EDIT:</p> <pre><code>protected void onCreate(Bundle savedInstanceState){ Intent i = getIntent(); String extraTopic = i.getStringExtra("SummTopic"); //or long extraTopic = i.getLongExtra("SummTopic"); if you put id there (which is better) mydb = openOrCreateDatabase(DBNAME, Context.MODE_PRIVATE,null); String[] args = new String[] { extraTopic }; //or String[] args = new String[] { Long.toString(extraTopic) }; with id version Cursor singleRow = mydb.rawQuery("SELECT * FROM "+ TABLE + " WHERE topic=?" , args); //args is better then escaping special chars in query //and it should be single row so we've changed var name :) if(singleRow.moveToFirst()){ //we should do moveToFirst before we can use Cursor Integer cindex = allrows.getColumnIndex("topic"); Integer cindex1 = allrows.getColumnIndex("text1"); Integer cindex2 = allrows.getColumnIndex("text2"); //setup views and stuff .... }else{ Toast.makeText(this, "Oops we did not find topic, detail activity was closed", Toast.LENGTH_SHORT).show(); finish(); } } </code></pre>
    singulars
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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