Last active
December 23, 2015 23:19
-
-
Save jpzhu/6709355 to your computer and use it in GitHub Desktop.
test code
This file contains 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
private void addPresetButton(){ | |
for(int i=0;i<6;i++){ | |
mChannelButton[i] = (Button) findViewById(mChannelButtonId[i]); | |
mChannelButton[i].setOnClickListener(this); | |
mChannelButton[i].setOnLongClickListener(this); | |
} | |
} | |
@Override | |
public void onClick(View v) { | |
for(int i=0;i<6;i++){ | |
if(v.getId() == mChannelButtonId[i]){ | |
presetClickEvent(mChannelButton[i]); | |
} | |
} | |
} | |
@Override | |
public boolean onLongClick(View v) { | |
for(int i=0;i<6;i++){ | |
if(v.getId() == mChannelButtonId[i]){ | |
presetLongClickEvent(mChannelButton[i], mChannelButtonId[i], mTabName); | |
} | |
} | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment