Skip to content

Instantly share code, notes, and snippets.

private ArrayList<Double> threeGrades = new ArrayList<Double>();
private ArrayList<Double> twoGrades = new ArrayList<Double>();
private ArrayList<Double> oneGrades = new ArrayList<Double>();
private ArrayList<ArrayList<Double>> gradesListContainer = new ArrayList<ArrayList<Double>>(){{
add(oneGrades);
add(twoGrades);
add(threeGrades);
private TextView threeTextView;
private TextView twoTextView;
private TextView oneTextView;
private TextView[] textViewsContainer = {oneTextView, twoTextView, threeTextView};
06-11 16:19:02.722: I/System.out(7780): MotionEvent{405134e0 action=0 x=254.80852 y=78.22581 pressure=74.29412 size=4.6000004}
06-11 16:19:02.511: I/System.out(7780): MotionEvent{405134e0 action=0 x=258.89362 y=64.462364 pressure=30.12157 size=3.5333335}
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/containerLinearLayout"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MainActivity" >
<Button
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/containerLinearLayout"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MainActivity" >
<Button
/* IN ONCREATE */
firstPlayerButton = (Button) findViewById(R.id.firstPlayerButton);
//Assign Color to the FIRST PLAYER
firstPlayerColor = r.getColor(R.color.player_one);
firstPlayerButton.setTag(new ColorAndReferenceToTextView(firstPlayerColor, (TextView) findViewById(R.id.firstPlayerResult)));
secondPlayerButton = (Button) findViewById(R.id.secondPlayerButton);
//Assign Color to the SECOND PLAYER
secondPlayerColor = r.getColor(R.color.player_two);
public MyClass(int myNameOfField) {
this.nameOfField = nameOfField;
}
public MyClass(int myNameOfField) {
this.nameOfField = nameOfField;
}
class myT extends CountDownTimer {
long myWholeTime;
public myT(long millisInFuture, long countDownInterval) {
super(millisInFuture, countDownInterval);
this.myWholeTime = millisInFuture;
}
// TODO Auto-generated constructor stub
@Override
public void onFinish() {
private void playDing(int howManyTimes) {
if(howManyTimes >0){
MediaPlayer mPlayer = MediaPlayer.create(this, R.raw.dingshort);
mPlayer.setOnCompletionListener(new OnCompletionListener() {
@Override
public void onCompletion(MediaPlayer mp) {
playDing(howManyTimes-1); //But java don't support closures