SortableTableView
SortableTableView copied to clipboard
Unable to set SimpleTableDataAdapter inside Fragment
I am unable to set SimpleTableDataAdapter inside Fragment.
tableView.setDataAdapter(new SimpleTableDataAdapter(this, body));
I have tried using the following, but none works.
tableView.setDataAdapter(new SimpleTableDataAdapter(getActivity().getApplicationContext(), body));
tableView.setDataAdapter(new SimpleTableDataAdapter(getActivity(), body));
Hi @arnab3111,
what means "unable". What effect to you see? Is the compiler complaining or do you have issues during runtime?
Best regards, Ingo
The compiler is complaining.
for getActivity() I am getting the following error
Cannot resolve constructor 'SimpleTableDataAdapter(android.support.v4.app.FragmentActivity, java.lang.String[])
and for getActivity().getApplicationContext() the following error
'Cannot resolve constructor SimpleTableDataAdapter(android.content.Context, java.lang.String[])
Use getContext()
Use TableDataAdapter instead of SimpleTableDataAdapter.