Created
May 31, 2012 00:00
-
-
Save alexjlockwood/2839680 to your computer and use it in GitHub Desktop.
Simple Debugging #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SampleActivity extends Activity { | |
/** | |
* A string constant to use in calls to the "log" methods. Its | |
* value is often given by the name of the class, as this will | |
* allow you to easily determine where log methods are coming | |
* from when you analyze your logcat output. | |
*/ | |
private static final String TAG = "SampleActivity"; | |
/** | |
* Toggle this boolean constant's value to turn on/off logging | |
* within the class. | |
*/ | |
private static final boolean VERBOSE = true; | |
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
if (VERBOSE) Log.v(TAG, "+++ ON CREATE +++"); | |
} | |
@Override | |
public void onStart() { | |
super.onStart(); | |
if (VERBOSE) Log.v(TAG, "++ ON START ++"); | |
} | |
@Override | |
public void onResume() { | |
super.onResume(); | |
if (VERBOSE) Log.v(TAG, "+ ON RESUME +"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment