vendredi 4 décembre 2015

Bundle arguments returning null

I'm trying to send some data from an SQLite database to a fragment via a bundle.

The debugger is showing that the cursor is returning all columns like it should, but the StringArrays are null when adding them to the bundle.

Any ideas as to why this is?

enter image description here

String names, categories, currencies, prices, dates;

@Override
public void transactionLoadComplete(Cursor cursor) {
    tData = cursor;
    while (tData.moveToNext()) {
        String[] Name = new String[]{DatabaseHelper.TRANSACTION_NAME};
        String[] Category = new String[]{DatabaseHelper.TRANSACTION_CATEGORY};
        String[] Currency = new String[]{DatabaseHelper.TRANSACTION_CURRENCY};
        String[] Price = new String[]{DatabaseHelper.TRANSACTION_PRICE};
        String[] Date = new String[]{DatabaseHelper.TRANSACTION_DATE};

        Bundle args = new Bundle();
        args.putStringArray(names, Name);
        args.putStringArray(categories, Category);
        args.putStringArray(currencies, Currency);
        args.putStringArray(prices, Price);
        args.putStringArray(dates, Date);
        TransactionsTab transactionsTab = new TransactionsTab();
        transactionsTab.setArguments(args);
    }
}

Aucun commentaire:

Enregistrer un commentaire