I want to view the contents of activity in a fragment, I have a table in activity that contains statistics and I want to compare it with other table in a fragment How can I do This?
Asked
Active
Viewed 56 times
-1
-
Show your code here please... – Onic Team May 17 '17 at 14:51
-
Why the whole question is bolded? – Picard May 17 '17 at 17:58
2 Answers
0
When you starting fragment put extra bundle into it:
https://stackoverflow.com/a/12739968/5577679
Or (wrong way) set that table to be static and just use it as it is part of the fragment:
String row1 = getActivity.yourTable[0];
0
In your activity create a function
public Table getYourTableStatistics(){
return yourTable;
}
in your fragment use it like
((YourActivity)getActivity()).getYourTableStatistics();

mudit_sen
- 1,470
- 15
- 24
-
-
Create a function a function for table layout then. Access it like mentioned above – mudit_sen May 17 '17 at 14:19