Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to refresh the tableview? #94

Closed
codemaster730 opened this issue Apr 20, 2017 · 3 comments
Closed

Is there a way to refresh the tableview? #94

codemaster730 opened this issue Apr 20, 2017 · 3 comments
Assignees

Comments

@codemaster730
Copy link

codemaster730 commented Apr 20, 2017

Hi there,
Thanks for the great library, it has been very helpful for my project.
Anyway, I couldn't figure out the way to refresh the tableview with new data.

transactionTableDataAdapter = new TransactionTableDataAdapter(this, transactionList); transactionTableView.setDataAdapter(transactionTableDataAdapter);

If I fresh the data in transactionList , tableview would also be refreshed?
Please let me know
Thanks

@codemaster730
Copy link
Author

codemaster730 commented Apr 20, 2017

I found this method doesn't work.
transactionTableDataAdapter.notifyDataSetChanged();

@ghost
Copy link

ghost commented May 1, 2017

It's working for me

// update your database in here
// ....

// show new data to tableview
transactionTableDataAdapter = new TransactionTableDataAdapter(this, transactionList);
transactionTableView.setDataAdapter(transactionTableDataAdapter);
transactionTableView.invalidate();

@ISchwarz23 ISchwarz23 self-assigned this May 7, 2017
@ISchwarz23
Copy link
Owner

Hi @axiom88-guru,

I'm glad, that my table helped you. It would be very nice, if you describe in #35 for what project and how you used this TableView there.

To answer you question: The intended way of using the TableDataAdapter was to call the notifyDataSetChanged method. This method is also used in the example app. So may you have a look at the example implementation https://github.com/ISchwarz23/SortableTableView/blob/master/app/src/main/java/de/codecrafters/tableviewexample/MainActivity.java#L44.

Best regards,
Ingo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants