I search for answer all day long, but when i try to get the table layout i am having null.
I found info that it may be another table layout with same name, but there is only one.
My .xml file :
and my code is here layout6 = (TableLayout)findViewById(R.id.shdslResultsTableLayout);
layout6.setVisibility(0);
always ends up with null pointer.
Please help.
If
findViewById()is returning a NPE, try some of these:TableLayoutexistssetContentViewbeforefindViewByIdI’m assuming the 3rd option I’ve listed is most likely your problem.
Re-cleaning the project may also help after each of these steps.