How to get a string variable from another activity to databaseaccess.class for using in a database query?
<p>Hi i have an activity that listing city names in a listview. i want to pass pressed item's text to databaseacces.class by bundle and using it as a variable in database selection query. But i cant use bundle because of databaseaccess.class isnt an activity. How can i do this?
code block in main activity:</p>

<pre><code>if (position&gt;=0){


        bundle.putString("cityname",String.valueOf(position+1));
        intent.putExtras(bundle);
</code></pre>

<p>and my databaseaccess.class code block:</p>

<pre><code>protected void onHandleIntent(Intent intent) {
    Bundle data=intent.getExtras();
     city=data.getString("cityname");

     city=(String) intent.getExtras().get("city");

}
    public List&lt;String&gt; getQuotes() {

        List&lt;String&gt; list = new ArrayList&lt;&gt;();
        Cursor cursor = database.rawQuery("SELECT * FROM bank_table WHERE City = "+city,null);
        cursor.moveToFirst();
        while (!cursor.isAfterLast()) {
            list.add(cursor.getString(1) + " " + cursor.getString(2) + "\nAdres: " + cursor.getString(3) + " " + cursor.getString(4) + " " + cursor.getString(5) + "\nTel: " + cursor.getString(6) + "\nFax: " + cursor.getString(7));

            cursor.moveToNext();
        }
        cursor.close();
        return list;
    }
}
</code></pre>