For getting the values from the database and create a jagged array, you may do something like below:
Take an ArrayList and store all the indexes in it.
for(int i = 0; i<myIndexList.size(); i++)
{
String[] s = null;
Log.e("", "current pos "+i);
Cursor mCur2 = mDb.sGetMySectionListData(myIndexList.get(i));
if(mCur2.getCount()>0)
{
s = new String[mCur2.getCount()];
mCur2.moveToFirst();
do
{
s[mCur2.getPosition()] = mCur2.getString(mCur2.getColumnIndex("section_data")));
}
while(mCur2.moveToNext());
}
mCur2.close();
mGenerateString(s, i, myIndexList.size());
}
Then you can generate the jagged array by using below method
private void mGenerateString(String[] mCurrString, int pos, int size)
{
mStr[pos] = mCurrString;
Log.e("", "string array : "+mStr[pos]);
}