Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>In your Start.java class:</strong></p> <pre><code>Intent i = new Intent(this, KilometerSQL.class); i.putExtra("KEY",YourData); </code></pre> <p><strong>In KilometerSQL.java class</strong></p> <pre><code>Bundle extras = getIntent().getExtras(); if(extras !=null) { String value = extras.getString("KEY"); } </code></pre> <p>/<code>/Declare ur Textview here and set text to value</code></p> <p><strong>EDIT</strong> Did u try above or you can also try <code>spinnerData(dataSpinner)</code> in start class and change <code>String spinnerData(String dataSpinner)</code> in killometerSql class</p> <p><strong>Start Class</strong></p> <pre><code>public void onItemSelected(AdapterView&lt;?&gt; parent, View arg1, int arg2, long arg3) { // TODO Auto-generated method stub String month = parent.getSelectedItem().toString(); //This is my month variable KilometerSQL spinner = new KilometerSQL(this); spinner.open(); String dataSpinner = KilometerSQL.spinnerData();//you said u want to pass from start to killometer ..Whats this line doing though spinner.close(); logbog.setText(dataSpinner); spinnerData(month); } </code></pre> <p><strong>Killometer class</strong></p> <pre><code> public static String spinnerData(String KEY_MONTH) { // TODO Auto-generated method stub String [] columns = new String []{ KEY_DAY, KEY_MONTH, KEY_YEAR, KEY_KILOMETER, KEY_LOCATIONS}; Cursor c = ourDatabase.query(DATABASE_TABLE, columns, KEY_MONTH, null, null, null, null); String result = ""; int iDay = c.getColumnIndex(KEY_DAY); int iMonth = c.getColumnIndex(KEY_MONTH); int iYear = c.getColumnIndex(KEY_YEAR); int iKilometer = c.getColumnIndex(KEY_KILOMETER); int iLocations = c.getColumnIndex(KEY_LOCATIONS); for (c.moveToFirst();!c.isAfterLast();c.moveToNext()){ result = result + c.getString(iDay) + "-" + c.getString(iMonth) + "-" + c.getString(iYear) + " " + c.getString(iKilometer) + " " + c.getString(iLocations) + "\n"; } return result; } </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. 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