이렇게 대책없이 소스를 올려서 죄송합니다 ㅜ 중간에 TAG의 의미를 알고싶습니다..
public static final String TAG = "ContactManager";
private Button mAddAccountButton;
private ListView mContactList;
private boolean mShowInvisible;
private CheckBox mShowInvisibleControl;
/**
* Called when the activity is first created. Responsible for initializing the UI.
*/
@Override
public void onCreate(Bundle savedInstanceState)
{
Log.v(TAG, "Activity State: onCreate()");
super.onCreate(savedInstanceState);
setContentView(R.layout.contact_manager);
// Obtain handles to UI objects
mAddAccountButton = (Button) findViewById(R.id.addContactButton);
mContactList = (ListView) findViewById(R.id.contactList);
mShowInvisibleControl = (CheckBox) findViewById(R.id.showInvisible);
// Initialize class properties
mShowInvisible = false;
mShowInvisibleControl.setChecked(mShowInvisible);
// Register handler for UI elements
mAddAccountButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Log.d(TAG, "mAddAccountButton clicked");
launchContactAdder();
}
});
mShowInvisibleControl.setOnCheckedChangeListener(new OnCheckedChangeListener() {
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
Log.d(TAG, "mShowInvisibleControl changed: " + isChecked);
mShowInvisible = isChecked;
populateContactList();
}
});
간단한거라 남겨봅니다.
TAG는 말 그대로 나중에 로그를 보면서 어떤 소스에서 나온 로그인지 확인하기 위한 일종의 표식입니다.
뭐 변수명을 TAG로 하시던 MYTAG로 하시든 그건 중요하지 않습니다.
Log.d(TAG, "mAddAccountButton clicked");
즉 나중에 로그가 출력될 때, TAG를 보고 아 어떤 소스에서 나온 거구나 하고 보기 쉽게 하겠다는 겁니다.
만약 저런 식으로 하지 않고 Log.d("", "mAddAccountButton clicked"); 라고 남기면 나중에 어디에 남긴 로그인지 알기 어렵겠죠