```
ArrayList<String> al = new ArrayList<String>();
    Cursor c = database.query("remedies", new String[] { "remedy" },
            "d_id=?", new String[] { "" + index }, null, null, null);
    while (c.moveToNext()) {
        al.add(c.getString(0));
    }
    c.close();

    TextView[] tv = new TextView[al.size()];
    for (int i = 0; i < al.size(); i++) {
        tv[i].setText(al.get(i));
    }

```

my logcat:

```
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.ayurvedicapp/com.example.ayurvedichomecure.Remedies}:
java.lang.NullPointerException

Exception at: tv[i].setText(al.get(i));

```

Plz give me solution