I'm trying to hide a textView in my layout after I receive a result from an activity. I have a variable declaration - View lblEmptyList, which I instantiate in the onCreate:
lblEmptyList = findViewById(R.id.emptyList);
I tried this:
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode == RESULT_OK) {
switch (requestCode) {
case 1:
...
lblEmptyList.setVisibility(View.GONE);
But I'm getting an "Unreachable code" error. I tried to access it directly like that:
findViewById(R.id.emptyList).setVisibility(View.GONE);
I tried to use numeric values instead of View.GONE, but I keep getting this "Unreachable code" error. How do I fix it?