Three points:
getSupportActionBar()
is called four times within the same method. Store it as a local variable and use the variable four times instead, to improve code cleaniness and readability.- When catching exceptions, be as specific as possible be as specific as possible. Catching
Throwable
is a horrible idea. Only catch the exceptions you need to catch (Which involves neitherError
s orRuntimeException
s. You shouldn't even wrap((DilbertFragmentActivity) getSherlockActivity()).toggleActionBar();
inside a try-catch statement. If you think that something can go wrong (like aNullPointerException
), make sure that it doesn't go wrong before you try to do it (by checking if something is not null for example). - If
viewPager
can be marked asprivate
, it is good practice to also mark it asprivate
.
Three points:
getSupportActionBar()
is called four times within the same method. Store it as a local variable and use the variable four times instead, to improve code cleaniness and readability.- When catching exceptions, be as specific as possible. Catching
Throwable
is a horrible idea. Only catch the exceptions you need to catch (Which involves neitherError
s orRuntimeException
s. You shouldn't even wrap((DilbertFragmentActivity) getSherlockActivity()).toggleActionBar();
inside a try-catch statement. If you think that something can go wrong (like aNullPointerException
), make sure that it doesn't go wrong before you try to do it (by checking if something is not null for example). - If
viewPager
can be marked asprivate
, it is good practice to also mark it asprivate
.
Three points:
getSupportActionBar()
is called four times within the same method. Store it as a local variable and use the variable four times instead, to improve code cleaniness and readability.- When catching exceptions, be as specific as possible. Catching
Throwable
is a horrible idea. Only catch the exceptions you need to catch (Which involves neitherError
s orRuntimeException
s. You shouldn't even wrap((DilbertFragmentActivity) getSherlockActivity()).toggleActionBar();
inside a try-catch statement. If you think that something can go wrong (like aNullPointerException
), make sure that it doesn't go wrong before you try to do it (by checking if something is not null for example). - If
viewPager
can be marked asprivate
, it is good practice to also mark it asprivate
.
Three points:
getSupportActionBar()
is called four times within the same method. Store it as a local variable and use the variable four times instead, to improve code cleaniness and readability.- When catching exceptions, be as specific as possible. Catching
Throwable
is a horrible idea. Only catch the exceptions you need to catch (Which involves neitherError
s orRuntimeException
s. You shouldn't even wrap((DilbertFragmentActivity) getSherlockActivity()).toggleActionBar();
inside a try-catch statement. If you think that something can go wrong (like aNullPointerException
), make sure that it doesn't go wrong before you try to do it (by checking if something is not null for example). - If
viewPager
can be marked asprivate
, it should be markedis good practice to also mark it asprivate
.
Three points:
getSupportActionBar()
is called four times within the same method. Store it as a local variable and use the variable four times instead, to improve code cleaniness and readability.- When catching exceptions, be as specific as possible. Catching
Throwable
is a horrible idea. Only catch the exceptions you need to catch (Which involves neitherError
s orRuntimeException
s. You shouldn't even wrap((DilbertFragmentActivity) getSherlockActivity()).toggleActionBar();
inside a try-catch statement. If you think that something can go wrong (like aNullPointerException
), make sure that it doesn't go wrong before you try to do it (by checking if something is not null for example). - If
viewPager
can be marked asprivate
, it should be marked asprivate
.
Three points:
getSupportActionBar()
is called four times within the same method. Store it as a local variable and use the variable four times instead, to improve code cleaniness and readability.- When catching exceptions, be as specific as possible. Catching
Throwable
is a horrible idea. Only catch the exceptions you need to catch (Which involves neitherError
s orRuntimeException
s. You shouldn't even wrap((DilbertFragmentActivity) getSherlockActivity()).toggleActionBar();
inside a try-catch statement. If you think that something can go wrong (like aNullPointerException
), make sure that it doesn't go wrong before you try to do it (by checking if something is not null for example). - If
viewPager
can be marked asprivate
, it is good practice to also mark it asprivate
.
Three points:
getSupportActionBar()
is called four times within the same method. Store it as a local variable and use the variable four times instead, to improve code cleaniness and readability.- When catching exceptions, be as specific as possible. Catching
Throwable
is a horrible idea. Only catch the exceptions you need to catch (Which involves neitherError
s orRuntimeException
s. You shouldn't even wrap((DilbertFragmentActivity) getSherlockActivity()).toggleActionBar();
inside a try-catch statement. If you think that something can go wrong (like aNullPointerException
), make sure that it doesn't go wrong before you try to do it (by checking if something is not null for example). - If
viewPager
can be marked asprivate
, it should be marked asprivate
.
lang-java