import java.util.Calendar ;

import java.util.GregorianCalendar ;

import org.apache.http.impl.client.DefaultHttpClient ;

import android.os.Bundle ;

import android.app.Activity ;

import android.content.Intent ;

import android.graphics.Color ;

import android.text.format.Time ;

import android.view.Menu ;

import android.view.View ;

import android.widget.Button ;

import android.widget.EditText ;

import android.widget.ImageView ;

import android.widget.TextView ;

public class CalendarActivity extends Activity {

Variables data = ( Variables ) this . getApplication ( ) ;

SessionManager session = new SessionManager ( ) ;

public final static String DATE = "com.<PRIVATE>.app.MESSAGE" ;

int monthCarry = 0 ;

int yearCarry = 0 ;

int ActualMonth = 0 ;

int ActualYear = 0 ;

int cyclecounter = 0 ;

boolean lp = false ;

boolean foward = true ;

CalenderDays [ ] calender = new CalenderDays [ 38 ] ; //sets up CalendarDays class

@Override

protected void onCreate ( Bundle savedInstanceState ) {

super . onCreate ( savedInstanceState ) ;

setContentView ( R. layout . activity_calendar ) ;

Calendar timez = Calendar . getInstance ( ) ; //create calendar for this month

yearCarry = timez. get ( Calendar . YEAR ) ;

monthCarry = timez. get ( Calendar . MONTH ) ;

ActualMonth = monthCarry ;

ActualYear = yearCarry ;

loadCalender ( ) ; //Loads all the values for the calendar

}

@Override

public boolean onCreateOptionsMenu ( Menu menu ) {

// Inflate the menu; this adds items to the action bar if it is present.

getMenuInflater ( ) . inflate ( R. menu . calender , menu ) ;

return true ;

}

public void loadCalender ( )

{

for ( int i = 0 ; i < 38 ; i ++ )

{

calender [ i ] = new CalenderDays ( ) ;

}

Calendar timez = Calendar . getInstance ( ) ; //create calendar for this month

int day = 1 ;

if ( timez. get ( Calendar . MONTH ) == monthCarry && timez. get ( Calendar . YEAR ) == yearCarry ) day = timez. get ( Calendar . DAY_OF_MONTH ) ;

Calendar time = new GregorianCalendar ( yearCarry, monthCarry, day ) ; //create calendar for this month

int monthDay = time. get ( Calendar . DAY_OF_MONTH ) ; //find how far through the current month we are

int weekDay = time. get ( Calendar . DAY_OF_WEEK ) ; //find how far through the current week we are

final TextView textViewToChange = ( TextView ) findViewById ( R. id . Month ) ; //finds and sets the current month name

if ( time. get ( Calendar . MONTH ) == 0 ) textViewToChange. setText ( "January " + yearCarry ) ;

if ( time. get ( Calendar . MONTH ) == 1 ) textViewToChange. setText ( "February " + yearCarry ) ;

if ( time. get ( Calendar . MONTH ) == 2 ) textViewToChange. setText ( "March " + yearCarry ) ;

if ( time. get ( Calendar . MONTH ) == 3 ) textViewToChange. setText ( "April " + yearCarry ) ;

if ( time. get ( Calendar . MONTH ) == 4 ) textViewToChange. setText ( "May " + yearCarry ) ;

if ( time. get ( Calendar . MONTH ) == 5 ) textViewToChange. setText ( "June " + yearCarry ) ;

if ( time. get ( Calendar . MONTH ) == 6 ) textViewToChange. setText ( "July " + yearCarry ) ;

if ( time. get ( Calendar . MONTH ) == 7 ) textViewToChange. setText ( "August " + yearCarry ) ;

if ( time. get ( Calendar . MONTH ) == 8 ) textViewToChange. setText ( "September " + yearCarry ) ;

if ( time. get ( Calendar . MONTH ) == 9 ) textViewToChange. setText ( "October " + yearCarry ) ;

if ( time. get ( Calendar . MONTH ) == 10 ) textViewToChange. setText ( "November " + yearCarry ) ;

if ( time. get ( Calendar . MONTH ) == 11 ) textViewToChange. setText ( "December " + yearCarry ) ;

while ( monthDay > 7 ) monthDay = monthDay - 7 ; //finds the first day of the month

int startDay ;

if ( monthDay == 7 )

{

startDay = weekDay ;

} else {

startDay = weekDay - monthDay ;

}

if ( startDay < 1 ) startDay = 7 + startDay ;

Calendar month = new GregorianCalendar ( yearCarry, monthCarry, 1 ) ;

int daysInMonth = month. getActualMaximum ( Calendar . DAY_OF_MONTH ) ;

int dayCounter = 1 ;

if ( foward == false )

{

cyclecounter = 0 ;

}

for ( int i = startDay ; i < daysInMonth + startDay ; i ++ ) //counts through the days and sets their values on the CalendarDays class

{

calender [ i ] . day = i - startDay + 1 ;

//ClientDay cDay = data.dbHandler.getClientDay(data.clientID, 1);

//if(cDay.fluidMenses.equals("Bleeding"))calender[i].period = true;

//calender[i].data = true;

if ( lp == true || calender [ i ] . period == false )

{

calender [ i ] . cycleDay = cyclecounter ;

cyclecounter ++;

} else {

cyclecounter = 0 ;

calender [ i ] . cycleDay = cyclecounter ;

cyclecounter ++;

}

if ( calender [ i ] . period == true ) lp = true ; else lp = false ;

if ( i == 0 )

{

Button button = ( Button ) findViewById ( R. id . b1 ) ;

button. setText ( String . valueOf ( dayCounter ) ) ;

button. setVisibility ( View . VISIBLE ) ;

ImageView image = ( ImageView ) findViewById ( R. id . CalG1 ) ;

if ( calender [ i ] . data == true ) image. setVisibility ( View . VISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalP1 ) ;

if ( calender [ i ] . period == true ) image. setVisibility ( View . VISIBLE ) ;

if ( time. get ( Calendar . DAY_OF_MONTH ) == i - startDay + 1 && ActualYear == yearCarry && ActualMonth == monthCarry ) button. setBackgroundColor ( Color . parseColor ( "#6095C9" ) ) ;

}

if ( i == 1 )

{

Button button = ( Button ) findViewById ( R. id . b2 ) ;

button. setText ( String . valueOf ( dayCounter ) ) ;

button. setVisibility ( View . VISIBLE ) ;

ImageView image = ( ImageView ) findViewById ( R. id . CalP2 ) ;

if ( calender [ i ] . period == true ) image. setVisibility ( View . VISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG2 ) ;

if ( calender [ i ] . data == true ) image. setVisibility ( View . VISIBLE ) ;

if ( time. get ( Calendar . DAY_OF_MONTH ) == i - startDay + 1 && ActualYear == yearCarry && ActualMonth == monthCarry ) button. setBackgroundColor ( Color . parseColor ( "#6095C9" ) ) ;

}

if ( i == 2 )

{

Button button = ( Button ) findViewById ( R. id . b3 ) ;

button. setText ( String . valueOf ( dayCounter ) ) ;

button. setVisibility ( View . VISIBLE ) ;

ImageView image = ( ImageView ) findViewById ( R. id . CalP3 ) ;

if ( calender [ i ] . period == true ) image. setVisibility ( View . VISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG3 ) ;

if ( calender [ i ] . data == true ) image. setVisibility ( View . VISIBLE ) ;

if ( time. get ( Calendar . DAY_OF_MONTH ) == i - startDay + 1 && ActualYear == yearCarry && ActualMonth == monthCarry ) button. setBackgroundColor ( Color . parseColor ( "#6095C9" ) ) ;

}

if ( i == 3 )

{

Button button = ( Button ) findViewById ( R. id . b4 ) ;

button. setText ( String . valueOf ( dayCounter ) ) ;

button. setVisibility ( View . VISIBLE ) ;

ImageView image = ( ImageView ) findViewById ( R. id . CalP4 ) ;

if ( calender [ i ] . period == true ) image. setVisibility ( View . VISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG4 ) ;

if ( calender [ i ] . data == true ) image. setVisibility ( View . VISIBLE ) ;

if ( time. get ( Calendar . DAY_OF_MONTH ) == i - startDay + 1 && ActualYear == yearCarry && ActualMonth == monthCarry ) button. setBackgroundColor ( Color . parseColor ( "#6095C9" ) ) ;

}

if ( i == 4 )

{

Button button = ( Button ) findViewById ( R. id . b5 ) ;

button. setText ( String . valueOf ( dayCounter ) ) ;

button. setVisibility ( View . VISIBLE ) ;

ImageView image = ( ImageView ) findViewById ( R. id . CalP5 ) ;

if ( calender [ i ] . period == true ) image. setVisibility ( View . VISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG5 ) ;

if ( calender [ i ] . data == true ) image. setVisibility ( View . VISIBLE ) ;

if ( time. get ( Calendar . DAY_OF_MONTH ) == i - startDay + 1 && ActualYear == yearCarry && ActualMonth == monthCarry ) button. setBackgroundColor ( Color . parseColor ( "#6095C9" ) ) ;

}

if ( i == 5 )

{

Button button = ( Button ) findViewById ( R. id . b6 ) ;

button. setText ( String . valueOf ( dayCounter ) ) ;

button. setVisibility ( View . VISIBLE ) ;

ImageView image = ( ImageView ) findViewById ( R. id . CalP6 ) ;

if ( calender [ i ] . period == true ) image. setVisibility ( View . VISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG6 ) ;

if ( calender [ i ] . data == true ) image. setVisibility ( View . VISIBLE ) ;

if ( time. get ( Calendar . DAY_OF_MONTH ) == i - startDay + 1 && ActualYear == yearCarry && ActualMonth == monthCarry ) button. setBackgroundColor ( Color . parseColor ( "#6095C9" ) ) ;

}

if ( i == 6 )

{

Button button = ( Button ) findViewById ( R. id . b7 ) ;

button. setText ( String . valueOf ( dayCounter ) ) ;

button. setVisibility ( View . VISIBLE ) ;

ImageView image = ( ImageView ) findViewById ( R. id . CalP7 ) ;

if ( calender [ i ] . period == true ) image. setVisibility ( View . VISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG7 ) ;

if ( calender [ i ] . data == true ) image. setVisibility ( View . VISIBLE ) ;

if ( time. get ( Calendar . DAY_OF_MONTH ) == i - startDay + 1 && ActualYear == yearCarry && ActualMonth == monthCarry ) button. setBackgroundColor ( Color . parseColor ( "#6095C9" ) ) ;

}

if ( i == 7 )

{

Button button = ( Button ) findViewById ( R. id . b8 ) ;

button. setText ( String . valueOf ( dayCounter ) ) ;

button. setVisibility ( View . VISIBLE ) ;

ImageView image = ( ImageView ) findViewById ( R. id . CalP8 ) ;

if ( calender [ i ] . period == true ) image. setVisibility ( View . VISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG8 ) ;

if ( calender [ i ] . data == true ) image. setVisibility ( View . VISIBLE ) ;

if ( time. get ( Calendar . DAY_OF_MONTH ) == i - startDay + 1 && ActualYear == yearCarry && ActualMonth == monthCarry ) button. setBackgroundColor ( Color . parseColor ( "#6095C9" ) ) ;

}

if ( i == 8 )

{

Button button = ( Button ) findViewById ( R. id . b9 ) ;

button. setText ( String . valueOf ( dayCounter ) ) ;

button. setVisibility ( View . VISIBLE ) ;

ImageView image = ( ImageView ) findViewById ( R. id . CalP9 ) ;

if ( calender [ i ] . period == true ) image. setVisibility ( View . VISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG9 ) ;

if ( calender [ i ] . data == true ) image. setVisibility ( View . VISIBLE ) ;

if ( time. get ( Calendar . DAY_OF_MONTH ) == i - startDay + 1 && ActualYear == yearCarry && ActualMonth == monthCarry ) button. setBackgroundColor ( Color . parseColor ( "#6095C9" ) ) ;

}

if ( i == 9 )

{

Button button = ( Button ) findViewById ( R. id . b10 ) ;

button. setText ( String . valueOf ( dayCounter ) ) ;

button. setVisibility ( View . VISIBLE ) ;

ImageView image = ( ImageView ) findViewById ( R. id . CalP10 ) ;

if ( calender [ i ] . period == true ) image. setVisibility ( View . VISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG10 ) ;

if ( calender [ i ] . data == true ) image. setVisibility ( View . VISIBLE ) ;

if ( time. get ( Calendar . DAY_OF_MONTH ) == i - startDay + 1 && ActualYear == yearCarry && ActualMonth == monthCarry ) button. setBackgroundColor ( Color . parseColor ( "#6095C9" ) ) ;

}

if ( i == 10 )

{

Button button = ( Button ) findViewById ( R. id . b11 ) ;

button. setText ( String . valueOf ( dayCounter ) ) ;

button. setVisibility ( View . VISIBLE ) ;

ImageView image = ( ImageView ) findViewById ( R. id . CalP11 ) ;

if ( calender [ i ] . period == true ) image. setVisibility ( View . VISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG11 ) ;

if ( calender [ i ] . data == true ) image. setVisibility ( View . VISIBLE ) ;

if ( time. get ( Calendar . DAY_OF_MONTH ) == i - startDay + 1 && ActualYear == yearCarry && ActualMonth == monthCarry ) button. setBackgroundColor ( Color . parseColor ( "#6095C9" ) ) ;

}

if ( i == 11 )

{

Button button = ( Button ) findViewById ( R. id . b12 ) ;

button. setText ( String . valueOf ( dayCounter ) ) ;

button. setVisibility ( View . VISIBLE ) ;

ImageView image = ( ImageView ) findViewById ( R. id . CalP12 ) ;

if ( calender [ i ] . period == true ) image. setVisibility ( View . VISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG12 ) ;

if ( calender [ i ] . data == true ) image. setVisibility ( View . VISIBLE ) ;

if ( time. get ( Calendar . DAY_OF_MONTH ) == i - startDay + 1 && ActualYear == yearCarry && ActualMonth == monthCarry ) button. setBackgroundColor ( Color . parseColor ( "#6095C9" ) ) ;

}

if ( i == 12 )

{

Button button = ( Button ) findViewById ( R. id . b13 ) ;

button. setText ( String . valueOf ( dayCounter ) ) ;

button. setVisibility ( View . VISIBLE ) ;

ImageView image = ( ImageView ) findViewById ( R. id . CalP13 ) ;

if ( calender [ i ] . period == true ) image. setVisibility ( View . VISIBLE ) ;

if ( time. get ( Calendar . DAY_OF_MONTH ) == i - startDay + 1 && ActualYear == yearCarry && ActualMonth == monthCarry ) button. setBackgroundColor ( Color . parseColor ( "#6095C9" ) ) ;

}

if ( i == 13 )

{

Button button = ( Button ) findViewById ( R. id . b14 ) ;

button. setText ( String . valueOf ( dayCounter ) ) ;

button. setVisibility ( View . VISIBLE ) ;

ImageView image = ( ImageView ) findViewById ( R. id . CalP14 ) ;

if ( calender [ i ] . period == true ) image. setVisibility ( View . VISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG14 ) ;

if ( calender [ i ] . data == true ) image. setVisibility ( View . VISIBLE ) ;

if ( time. get ( Calendar . DAY_OF_MONTH ) == i - startDay + 1 && ActualYear == yearCarry && ActualMonth == monthCarry ) button. setBackgroundColor ( Color . parseColor ( "#6095C9" ) ) ;

}

if ( i == 14 )

{

Button button = ( Button ) findViewById ( R. id . b15 ) ;

button. setText ( String . valueOf ( dayCounter ) ) ;

button. setVisibility ( View . VISIBLE ) ;

ImageView image = ( ImageView ) findViewById ( R. id . CalP15 ) ;

if ( calender [ i ] . period == true ) image. setVisibility ( View . VISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG15 ) ;

if ( calender [ i ] . data == true ) image. setVisibility ( View . VISIBLE ) ;

if ( time. get ( Calendar . DAY_OF_MONTH ) == i - startDay + 1 && ActualYear == yearCarry && ActualMonth == monthCarry ) button. setBackgroundColor ( Color . parseColor ( "#6095C9" ) ) ;

}

if ( i == 15 )

{

Button button = ( Button ) findViewById ( R. id . b16 ) ;

button. setText ( String . valueOf ( dayCounter ) ) ;

button. setVisibility ( View . VISIBLE ) ;

ImageView image = ( ImageView ) findViewById ( R. id . CalP16 ) ;

if ( calender [ i ] . period == true ) image. setVisibility ( View . VISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG16 ) ;

if ( calender [ i ] . data == true ) image. setVisibility ( View . VISIBLE ) ;

if ( time. get ( Calendar . DAY_OF_MONTH ) == i - startDay + 1 && ActualYear == yearCarry && ActualMonth == monthCarry ) button. setBackgroundColor ( Color . parseColor ( "#6095C9" ) ) ;

}

if ( i == 16 )

{

Button button = ( Button ) findViewById ( R. id . b17 ) ;

button. setText ( String . valueOf ( dayCounter ) ) ;

button. setVisibility ( View . VISIBLE ) ;

ImageView image = ( ImageView ) findViewById ( R. id . CalP17 ) ;

if ( calender [ i ] . period == true ) image. setVisibility ( View . VISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG17 ) ;

if ( calender [ i ] . data == true ) image. setVisibility ( View . VISIBLE ) ;

if ( time. get ( Calendar . DAY_OF_MONTH ) == i - startDay + 1 && ActualYear == yearCarry && ActualMonth == monthCarry ) button. setBackgroundColor ( Color . parseColor ( "#6095C9" ) ) ;

}

if ( i == 17 )

{

Button button = ( Button ) findViewById ( R. id . b18 ) ;

button. setText ( String . valueOf ( dayCounter ) ) ;

button. setVisibility ( View . VISIBLE ) ;

ImageView image = ( ImageView ) findViewById ( R. id . CalP18 ) ;

if ( calender [ i ] . period == true ) image. setVisibility ( View . VISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG18 ) ;

if ( calender [ i ] . data == true ) image. setVisibility ( View . VISIBLE ) ;

if ( time. get ( Calendar . DAY_OF_MONTH ) == i - startDay + 1 && ActualYear == yearCarry && ActualMonth == monthCarry ) button. setBackgroundColor ( Color . parseColor ( "#6095C9" ) ) ;

}

if ( i == 18 )

{

Button button = ( Button ) findViewById ( R. id . b19 ) ;

button. setText ( String . valueOf ( dayCounter ) ) ;

button. setVisibility ( View . VISIBLE ) ;

ImageView image = ( ImageView ) findViewById ( R. id . CalP19 ) ;

if ( calender [ i ] . period == true ) image. setVisibility ( View . VISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG19 ) ;

if ( calender [ i ] . data == true ) image. setVisibility ( View . VISIBLE ) ;

if ( time. get ( Calendar . DAY_OF_MONTH ) == i - startDay + 1 && ActualYear == yearCarry && ActualMonth == monthCarry ) button. setBackgroundColor ( Color . parseColor ( "#6095C9" ) ) ;

}

if ( i == 19 )

{

Button button = ( Button ) findViewById ( R. id . b20 ) ;

button. setText ( String . valueOf ( dayCounter ) ) ;

button. setVisibility ( View . VISIBLE ) ;

ImageView image = ( ImageView ) findViewById ( R. id . CalP20 ) ;

if ( calender [ i ] . period == true ) image. setVisibility ( View . VISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG20 ) ;

if ( calender [ i ] . data == true ) image. setVisibility ( View . VISIBLE ) ;

if ( time. get ( Calendar . DAY_OF_MONTH ) == i - startDay + 1 && ActualYear == yearCarry && ActualMonth == monthCarry ) button. setBackgroundColor ( Color . parseColor ( "#6095C9" ) ) ;

}

if ( i == 20 )

{

Button button = ( Button ) findViewById ( R. id . b21 ) ;

button. setText ( String . valueOf ( dayCounter ) ) ;

button. setVisibility ( View . VISIBLE ) ;

ImageView image = ( ImageView ) findViewById ( R. id . CalP21 ) ;

if ( calender [ i ] . period == true ) image. setVisibility ( View . VISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG21 ) ;

if ( calender [ i ] . data == true ) image. setVisibility ( View . VISIBLE ) ;

if ( time. get ( Calendar . DAY_OF_MONTH ) == i - startDay + 1 && ActualYear == yearCarry && ActualMonth == monthCarry ) button. setBackgroundColor ( Color . parseColor ( "#6095C9" ) ) ;

}

if ( i == 21 )

{

Button button = ( Button ) findViewById ( R. id . b22 ) ;

button. setText ( String . valueOf ( dayCounter ) ) ;

button. setVisibility ( View . VISIBLE ) ;

ImageView image = ( ImageView ) findViewById ( R. id . CalP22 ) ;

if ( calender [ i ] . period == true ) image. setVisibility ( View . VISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG22 ) ;

if ( calender [ i ] . data == true ) image. setVisibility ( View . VISIBLE ) ;

if ( time. get ( Calendar . DAY_OF_MONTH ) == i - startDay + 1 && ActualYear == yearCarry && ActualMonth == monthCarry ) button. setBackgroundColor ( Color . parseColor ( "#6095C9" ) ) ;

}

if ( i == 22 )

{

Button button = ( Button ) findViewById ( R. id . b23 ) ;

button. setText ( String . valueOf ( dayCounter ) ) ;

button. setVisibility ( View . VISIBLE ) ;

ImageView image = ( ImageView ) findViewById ( R. id . CalP23 ) ;

if ( calender [ i ] . period == true ) image. setVisibility ( View . VISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG23 ) ;

if ( calender [ i ] . data == true ) image. setVisibility ( View . VISIBLE ) ;

if ( time. get ( Calendar . DAY_OF_MONTH ) == i - startDay + 1 && ActualYear == yearCarry && ActualMonth == monthCarry ) button. setBackgroundColor ( Color . parseColor ( "#6095C9" ) ) ;

}

if ( i == 23 )

{

Button button = ( Button ) findViewById ( R. id . b24 ) ;

button. setText ( String . valueOf ( dayCounter ) ) ;

button. setVisibility ( View . VISIBLE ) ;

ImageView image = ( ImageView ) findViewById ( R. id . CalP24 ) ;

if ( calender [ i ] . period == true ) image. setVisibility ( View . VISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG24 ) ;

if ( calender [ i ] . data == true ) image. setVisibility ( View . VISIBLE ) ;

if ( time. get ( Calendar . DAY_OF_MONTH ) == i - startDay + 1 && ActualYear == yearCarry && ActualMonth == monthCarry ) button. setBackgroundColor ( Color . parseColor ( "#6095C9" ) ) ;

}

if ( i == 24 )

{

Button button = ( Button ) findViewById ( R. id . b25 ) ;

button. setText ( String . valueOf ( dayCounter ) ) ;

button. setVisibility ( View . VISIBLE ) ;

ImageView image = ( ImageView ) findViewById ( R. id . CalP25 ) ;

if ( calender [ i ] . period == true ) image. setVisibility ( View . VISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG25 ) ;

if ( calender [ i ] . data == true ) image. setVisibility ( View . VISIBLE ) ;

if ( time. get ( Calendar . DAY_OF_MONTH ) == i - startDay + 1 && ActualYear == yearCarry && ActualMonth == monthCarry ) button. setBackgroundColor ( Color . parseColor ( "#6095C9" ) ) ;

}

if ( i == 25 )

{

Button button = ( Button ) findViewById ( R. id . b26 ) ;

button. setText ( String . valueOf ( dayCounter ) ) ;

button. setVisibility ( View . VISIBLE ) ;

ImageView image = ( ImageView ) findViewById ( R. id . CalP26 ) ;

if ( calender [ i ] . period == true ) image. setVisibility ( View . VISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG26 ) ;

if ( calender [ i ] . data == true ) image. setVisibility ( View . VISIBLE ) ;

if ( time. get ( Calendar . DAY_OF_MONTH ) == i - startDay + 1 && ActualYear == yearCarry && ActualMonth == monthCarry ) button. setBackgroundColor ( Color . parseColor ( "#6095C9" ) ) ;

}

if ( i == 26 )

{

Button button = ( Button ) findViewById ( R. id . b27 ) ;

button. setText ( String . valueOf ( dayCounter ) ) ;

button. setVisibility ( View . VISIBLE ) ;

ImageView image = ( ImageView ) findViewById ( R. id . CalP27 ) ;

if ( calender [ i ] . period == true ) image. setVisibility ( View . VISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG27 ) ;

if ( calender [ i ] . data == true ) image. setVisibility ( View . VISIBLE ) ;

if ( time. get ( Calendar . DAY_OF_MONTH ) == i - startDay + 1 && ActualYear == yearCarry && ActualMonth == monthCarry ) button. setBackgroundColor ( Color . parseColor ( "#6095C9" ) ) ;

}

if ( i == 27 )

{

Button button = ( Button ) findViewById ( R. id . b28 ) ;

button. setText ( String . valueOf ( dayCounter ) ) ;

button. setVisibility ( View . VISIBLE ) ;

ImageView image = ( ImageView ) findViewById ( R. id . CalP28 ) ;

if ( calender [ i ] . period == true ) image. setVisibility ( View . VISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG28 ) ;

if ( calender [ i ] . data == true ) image. setVisibility ( View . VISIBLE ) ;

if ( time. get ( Calendar . DAY_OF_MONTH ) == i - startDay + 1 && ActualYear == yearCarry && ActualMonth == monthCarry ) button. setBackgroundColor ( Color . parseColor ( "#6095C9" ) ) ;

}

if ( i == 28 )

{

Button button = ( Button ) findViewById ( R. id . b29 ) ;

button. setText ( String . valueOf ( dayCounter ) ) ;

button. setVisibility ( View . VISIBLE ) ;

ImageView image = ( ImageView ) findViewById ( R. id . CalP29 ) ;

if ( calender [ i ] . period == true ) image. setVisibility ( View . VISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG29 ) ;

if ( calender [ i ] . data == true ) image. setVisibility ( View . VISIBLE ) ;

if ( time. get ( Calendar . DAY_OF_MONTH ) == i - startDay + 1 && ActualYear == yearCarry && ActualMonth == monthCarry ) button. setBackgroundColor ( Color . parseColor ( "#6095C9" ) ) ;

}

if ( i == 29 )

{

Button button = ( Button ) findViewById ( R. id . b30 ) ;

button. setText ( String . valueOf ( dayCounter ) ) ;

button. setVisibility ( View . VISIBLE ) ;

ImageView image = ( ImageView ) findViewById ( R. id . CalP30 ) ;

if ( calender [ i ] . period == true ) image. setVisibility ( View . VISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG30 ) ;

if ( calender [ i ] . data == true ) image. setVisibility ( View . VISIBLE ) ;

if ( time. get ( Calendar . DAY_OF_MONTH ) == i - startDay + 1 && ActualYear == yearCarry && ActualMonth == monthCarry ) button. setBackgroundColor ( Color . parseColor ( "#6095C9" ) ) ;

}

if ( i == 30 )

{

Button button = ( Button ) findViewById ( R. id . b31 ) ;

button. setText ( String . valueOf ( dayCounter ) ) ;

button. setVisibility ( View . VISIBLE ) ;

ImageView image = ( ImageView ) findViewById ( R. id . CalP31 ) ;

if ( calender [ i ] . period == true ) image. setVisibility ( View . VISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG31 ) ;

if ( calender [ i ] . data == true ) image. setVisibility ( View . VISIBLE ) ;

if ( time. get ( Calendar . DAY_OF_MONTH ) == i - startDay + 1 && ActualYear == yearCarry && ActualMonth == monthCarry ) button. setBackgroundColor ( Color . parseColor ( "#6095C9" ) ) ;

}

if ( i == 31 )

{

Button button = ( Button ) findViewById ( R. id . b32 ) ;

button. setText ( String . valueOf ( dayCounter ) ) ;

button. setVisibility ( View . VISIBLE ) ;

ImageView image = ( ImageView ) findViewById ( R. id . CalP32 ) ;

if ( calender [ i ] . period == true ) image. setVisibility ( View . VISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG32 ) ;

if ( calender [ i ] . data == true ) image. setVisibility ( View . VISIBLE ) ;

if ( time. get ( Calendar . DAY_OF_MONTH ) == i - startDay + 1 && ActualYear == yearCarry && ActualMonth == monthCarry ) button. setBackgroundColor ( Color . parseColor ( "#6095C9" ) ) ;

}

if ( i == 32 )

{

Button button = ( Button ) findViewById ( R. id . b33 ) ;

button. setText ( String . valueOf ( dayCounter ) ) ;

button. setVisibility ( View . VISIBLE ) ;

ImageView image = ( ImageView ) findViewById ( R. id . CalP33 ) ;

if ( calender [ i ] . period == true ) image. setVisibility ( View . VISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG33 ) ;

if ( calender [ i ] . data == true ) image. setVisibility ( View . VISIBLE ) ;

if ( time. get ( Calendar . DAY_OF_MONTH ) == i - startDay + 1 && ActualYear == yearCarry && ActualMonth == monthCarry ) button. setBackgroundColor ( Color . parseColor ( "#6095C9" ) ) ;

}

if ( i == 33 )

{

Button button = ( Button ) findViewById ( R. id . b34 ) ;

button. setText ( String . valueOf ( dayCounter ) ) ;

button. setVisibility ( View . VISIBLE ) ;

ImageView image = ( ImageView ) findViewById ( R. id . CalP34 ) ;

if ( calender [ i ] . period == true ) image. setVisibility ( View . VISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG34 ) ;

if ( calender [ i ] . data == true ) image. setVisibility ( View . VISIBLE ) ;

if ( time. get ( Calendar . DAY_OF_MONTH ) == i - startDay + 1 && ActualYear == yearCarry && ActualMonth == monthCarry ) button. setBackgroundColor ( Color . parseColor ( "#6095C9" ) ) ;

}

if ( i == 34 )

{

Button button = ( Button ) findViewById ( R. id . b35 ) ;

button. setText ( String . valueOf ( dayCounter ) ) ;

button. setVisibility ( View . VISIBLE ) ;

ImageView image = ( ImageView ) findViewById ( R. id . CalP35 ) ;

if ( calender [ i ] . period == true ) image. setVisibility ( View . VISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG35 ) ;

if ( calender [ i ] . data == true ) image. setVisibility ( View . VISIBLE ) ;

if ( time. get ( Calendar . DAY_OF_MONTH ) == i - startDay + 1 && ActualYear == yearCarry && ActualMonth == monthCarry ) button. setBackgroundColor ( Color . parseColor ( "#6095C9" ) ) ;

}

if ( i == 35 )

{

Button button = ( Button ) findViewById ( R. id . b36 ) ;

button. setText ( String . valueOf ( dayCounter ) ) ;

button. setVisibility ( View . VISIBLE ) ;

ImageView image = ( ImageView ) findViewById ( R. id . CalP36 ) ;

if ( calender [ i ] . period == true ) image. setVisibility ( View . VISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG36 ) ;

if ( calender [ i ] . data == true ) image. setVisibility ( View . VISIBLE ) ;

if ( time. get ( Calendar . DAY_OF_MONTH ) == i - startDay + 1 && ActualYear == yearCarry && ActualMonth == monthCarry ) button. setBackgroundColor ( Color . parseColor ( "#6095C9" ) ) ;

}

if ( i == 36 )

{

Button button = ( Button ) findViewById ( R. id . b37 ) ;

button. setText ( String . valueOf ( dayCounter ) ) ;

button. setVisibility ( View . VISIBLE ) ;

ImageView image = ( ImageView ) findViewById ( R. id . CalP37 ) ;

if ( calender [ i ] . period == true ) image. setVisibility ( View . VISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG37 ) ;

if ( calender [ i ] . data == true ) image. setVisibility ( View . VISIBLE ) ;

if ( time. get ( Calendar . DAY_OF_MONTH ) == i - startDay + 1 && ActualYear == yearCarry && ActualMonth == monthCarry ) button. setBackgroundColor ( Color . parseColor ( "#6095C9" ) ) ;

}

if ( i == 37 )

{

Button button = ( Button ) findViewById ( R. id . b38 ) ;

button. setText ( String . valueOf ( dayCounter ) ) ;

button. setVisibility ( View . VISIBLE ) ;

ImageView image = ( ImageView ) findViewById ( R. id . CalP38 ) ;

if ( calender [ i ] . period == true ) image. setVisibility ( View . VISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG38 ) ;

if ( calender [ i ] . data == true ) image. setVisibility ( View . VISIBLE ) ;

if ( time. get ( Calendar . DAY_OF_MONTH ) == i - startDay + 1 && ActualYear == yearCarry && ActualMonth == monthCarry ) button. setBackgroundColor ( Color . parseColor ( "#6095C9" ) ) ;

}

if ( i == 38 )

{

Button button = ( Button ) findViewById ( R. id . b39 ) ;

button. setText ( String . valueOf ( dayCounter ) ) ;

button. setVisibility ( View . VISIBLE ) ;

ImageView image = ( ImageView ) findViewById ( R. id . CalP39 ) ;

if ( calender [ i ] . period == true ) image. setVisibility ( View . VISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG39 ) ;

if ( calender [ i ] . data == true ) image. setVisibility ( View . VISIBLE ) ;

if ( time. get ( Calendar . DAY_OF_MONTH ) == i - startDay + 1 && ActualYear == yearCarry && ActualMonth == monthCarry ) button. setBackgroundColor ( Color . parseColor ( "#6095C9" ) ) ;

}

if ( i == 39 )

{

Button button = ( Button ) findViewById ( R. id . b40 ) ;

button. setText ( String . valueOf ( dayCounter ) ) ;

button. setVisibility ( View . VISIBLE ) ;

ImageView image = ( ImageView ) findViewById ( R. id . CalP40 ) ;

if ( calender [ i ] . period == true ) image. setVisibility ( View . VISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG40 ) ;

if ( calender [ i ] . data == true ) image. setVisibility ( View . VISIBLE ) ;

if ( time. get ( Calendar . DAY_OF_MONTH ) == i - startDay + 1 && ActualYear == yearCarry && ActualMonth == monthCarry ) button. setBackgroundColor ( Color . parseColor ( "#6095C9" ) ) ;

}

if ( i == 40 )

{

Button button = ( Button ) findViewById ( R. id . b41 ) ;

button. setText ( String . valueOf ( dayCounter ) ) ;

button. setVisibility ( View . VISIBLE ) ;

ImageView image = ( ImageView ) findViewById ( R. id . CalP41 ) ;

if ( calender [ i ] . period == true ) image. setVisibility ( View . VISIBLE ) ;

if ( time. get ( Calendar . DAY_OF_MONTH ) == i - startDay + 1 && ActualYear == yearCarry && ActualMonth == monthCarry ) button. setBackgroundColor ( Color . parseColor ( "#6095C9" ) ) ;

}

if ( i == 41 )

{

Button button = ( Button ) findViewById ( R. id . b42 ) ;

button. setText ( String . valueOf ( dayCounter ) ) ;

button. setVisibility ( View . VISIBLE ) ;

ImageView image = ( ImageView ) findViewById ( R. id . CalP42 ) ;

if ( calender [ i ] . period == true ) image. setVisibility ( View . VISIBLE ) ;

if ( time. get ( Calendar . DAY_OF_MONTH ) == i - startDay + 1 && ActualYear == yearCarry && ActualMonth == monthCarry ) button. setBackgroundColor ( Color . parseColor ( "#6095C9" ) ) ;

}

dayCounter ++;

}

}

public void b1Pressed ( View view ) {

Intent intent = new Intent ( this , DayDataActivity. class ) ;

String message = "" + calender [ 0 ] . day + "," + ( monthCarry + 1 ) + "," + yearCarry ;

intent. putExtra ( DATE, message ) ;

startActivity ( intent ) ;

}

public void b2Pressed ( View view ) {

Intent intent = new Intent ( this , DayDataActivity. class ) ;

String message = "" + calender [ 1 ] . day + "," + ( monthCarry + 1 ) + "," + yearCarry ;

intent. putExtra ( DATE, message ) ;

startActivity ( intent ) ;

}

public void b3Pressed ( View view ) {

Intent intent = new Intent ( this , DayDataActivity. class ) ;

String message = "" + calender [ 2 ] . day + "," + ( monthCarry + 1 ) + "," + yearCarry ;

intent. putExtra ( DATE, message ) ;

startActivity ( intent ) ;

}

public void b4Pressed ( View view ) {

Intent intent = new Intent ( this , DayDataActivity. class ) ;

String message = "" + calender [ 3 ] . day + "," + ( monthCarry + 1 ) + "," + yearCarry ;

intent. putExtra ( DATE, message ) ;

startActivity ( intent ) ;

}

public void b5Pressed ( View view ) {

Intent intent = new Intent ( this , DayDataActivity. class ) ;

String message = "" + calender [ 4 ] . day + "," + ( monthCarry + 1 ) + "," + yearCarry ;

intent. putExtra ( DATE, message ) ;

startActivity ( intent ) ;

}

public void b6Pressed ( View view ) {

Intent intent = new Intent ( this , DayDataActivity. class ) ;

String message = "" + calender [ 5 ] . day + "," + ( monthCarry + 1 ) + "," + yearCarry ;

intent. putExtra ( DATE, message ) ;

startActivity ( intent ) ;

}

public void b7Pressed ( View view ) {

Intent intent = new Intent ( this , DayDataActivity. class ) ;

String message = "" + calender [ 6 ] . day + "," + ( monthCarry + 1 ) + "," + yearCarry ;

intent. putExtra ( DATE, message ) ;

startActivity ( intent ) ;

}

public void b8Pressed ( View view ) {

Intent intent = new Intent ( this , DayDataActivity. class ) ;

String message = "" + calender [ 7 ] . day + "," + ( monthCarry + 1 ) + "," + yearCarry ;

intent. putExtra ( DATE, message ) ;

startActivity ( intent ) ;

}

public void b9Pressed ( View view ) {

Intent intent = new Intent ( this , DayDataActivity. class ) ;

String message = "" + calender [ 8 ] . day + "," + ( monthCarry + 1 ) + "," + yearCarry ;

intent. putExtra ( DATE, message ) ;

startActivity ( intent ) ;

}

public void b10Pressed ( View view ) {

Intent intent = new Intent ( this , DayDataActivity. class ) ;

String message = "" + calender [ 9 ] . day + "," + ( monthCarry + 1 ) + "," + yearCarry ;

intent. putExtra ( DATE, message ) ;

startActivity ( intent ) ;

}

public void b11Pressed ( View view ) {

Intent intent = new Intent ( this , DayDataActivity. class ) ;

String message = "" + calender [ 10 ] . day + "," + ( monthCarry + 1 ) + "," + yearCarry ;

intent. putExtra ( DATE, message ) ;

startActivity ( intent ) ;

}

public void b12Pressed ( View view ) {

Intent intent = new Intent ( this , DayDataActivity. class ) ;

String message = "" + calender [ 11 ] . day + "," + ( monthCarry + 1 ) + "," + yearCarry ;

intent. putExtra ( DATE, message ) ;

startActivity ( intent ) ;

}

public void b13Pressed ( View view ) {

Intent intent = new Intent ( this , DayDataActivity. class ) ;

String message = "" + calender [ 12 ] . day + "," + ( monthCarry + 1 ) + "," + yearCarry ;

intent. putExtra ( DATE, message ) ;

startActivity ( intent ) ;

}

public void b14Pressed ( View view ) {

Intent intent = new Intent ( this , DayDataActivity. class ) ;

String message = "" + calender [ 13 ] . day + "," + ( monthCarry + 1 ) + "," + yearCarry ;

intent. putExtra ( DATE, message ) ;

startActivity ( intent ) ;

}

public void b15Pressed ( View view ) {

Intent intent = new Intent ( this , DayDataActivity. class ) ;

String message = "" + calender [ 14 ] . day + "," + ( monthCarry + 1 ) + "," + yearCarry ;

intent. putExtra ( DATE, message ) ;

startActivity ( intent ) ;

}

public void b16Pressed ( View view ) {

Intent intent = new Intent ( this , DayDataActivity. class ) ;

String message = "" + calender [ 15 ] . day + "," + ( monthCarry + 1 ) + "," + yearCarry ;

intent. putExtra ( DATE, message ) ;

startActivity ( intent ) ;

}

public void b17Pressed ( View view ) {

Intent intent = new Intent ( this , DayDataActivity. class ) ;

String message = "" + calender [ 16 ] . day + "," + ( monthCarry + 1 ) + "," + yearCarry ;

intent. putExtra ( DATE, message ) ;

startActivity ( intent ) ;

}

public void b18Pressed ( View view ) {

Intent intent = new Intent ( this , DayDataActivity. class ) ;

String message = "" + calender [ 17 ] . day + "," + ( monthCarry + 1 ) + "," + yearCarry ;

intent. putExtra ( DATE, message ) ;

startActivity ( intent ) ;

}

public void b19Pressed ( View view ) {

Intent intent = new Intent ( this , DayDataActivity. class ) ;

String message = "" + calender [ 18 ] . day + "," + ( monthCarry + 1 ) + "," + yearCarry ;

intent. putExtra ( DATE, message ) ;

startActivity ( intent ) ;

}

public void b20Pressed ( View view ) {

Intent intent = new Intent ( this , DayDataActivity. class ) ;

String message = "" + calender [ 19 ] . day + "," + ( monthCarry + 1 ) + "," + yearCarry ;

intent. putExtra ( DATE, message ) ;

startActivity ( intent ) ;

}

public void b21Pressed ( View view ) {

Intent intent = new Intent ( this , DayDataActivity. class ) ;

String message = "" + calender [ 20 ] . day + "," + ( monthCarry + 1 ) + "," + yearCarry ;

intent. putExtra ( DATE, message ) ;

startActivity ( intent ) ;

}

public void b22Pressed ( View view ) {

Intent intent = new Intent ( this , DayDataActivity. class ) ;

String message = "" + calender [ 21 ] . day + "," + ( monthCarry + 1 ) + "," + yearCarry ;

intent. putExtra ( DATE, message ) ;

startActivity ( intent ) ;

}

public void b23Pressed ( View view ) {

Intent intent = new Intent ( this , DayDataActivity. class ) ;

String message = "" + calender [ 22 ] . day + "," + ( monthCarry + 1 ) + "," + yearCarry ;

intent. putExtra ( DATE, message ) ;

startActivity ( intent ) ;

}

public void b24Pressed ( View view ) {

Intent intent = new Intent ( this , DayDataActivity. class ) ;

String message = "" + calender [ 23 ] . day + "," + ( monthCarry + 1 ) + "," + yearCarry ;

intent. putExtra ( DATE, message ) ;

startActivity ( intent ) ;

}

public void b25Pressed ( View view ) {

Intent intent = new Intent ( this , DayDataActivity. class ) ;

String message = "" + calender [ 24 ] . day + "," + ( monthCarry + 1 ) + "," + yearCarry ;

intent. putExtra ( DATE, message ) ;

startActivity ( intent ) ;

}

public void b26Pressed ( View view ) {

Intent intent = new Intent ( this , DayDataActivity. class ) ;

String message = "" + calender [ 25 ] . day + "," + ( monthCarry + 1 ) + "," + yearCarry ;

intent. putExtra ( DATE, message ) ;

startActivity ( intent ) ;

}

public void b27Pressed ( View view ) {

Intent intent = new Intent ( this , DayDataActivity. class ) ;

String message = "" + calender [ 26 ] . day + "," + ( monthCarry + 1 ) + "," + yearCarry ;

intent. putExtra ( DATE, message ) ;

startActivity ( intent ) ;

}

public void b28Pressed ( View view ) {

Intent intent = new Intent ( this , DayDataActivity. class ) ;

String message = "" + calender [ 27 ] . day + "," + ( monthCarry + 1 ) + "," + yearCarry ;

intent. putExtra ( DATE, message ) ;

startActivity ( intent ) ;

}

public void b29Pressed ( View view ) {

Intent intent = new Intent ( this , DayDataActivity. class ) ;

String message = "" + calender [ 28 ] . day + "," + ( monthCarry + 1 ) + "," + yearCarry ;

intent. putExtra ( DATE, message ) ;

startActivity ( intent ) ;

}

public void b30Pressed ( View view ) {

Intent intent = new Intent ( this , DayDataActivity. class ) ;

String message = "" + calender [ 29 ] . day + "," + ( monthCarry + 1 ) + "," + yearCarry ;

intent. putExtra ( DATE, message ) ;

startActivity ( intent ) ;

}

public void b31Pressed ( View view ) {

Intent intent = new Intent ( this , DayDataActivity. class ) ;

String message = "" + calender [ 30 ] . day + "," + ( monthCarry + 1 ) + "," + yearCarry ;

intent. putExtra ( DATE, message ) ;

startActivity ( intent ) ;

}

public void b32Pressed ( View view ) {

Intent intent = new Intent ( this , DayDataActivity. class ) ;

String message = "" + calender [ 31 ] . day + "," + ( monthCarry + 1 ) + "," + yearCarry ;

intent. putExtra ( DATE, message ) ;

startActivity ( intent ) ;

}

public void b33Pressed ( View view ) {

Intent intent = new Intent ( this , DayDataActivity. class ) ;

String message = "" + calender [ 32 ] . day + "," + ( monthCarry + 1 ) + "," + yearCarry ;

intent. putExtra ( DATE, message ) ;

startActivity ( intent ) ;

}

public void b34Pressed ( View view ) {

Intent intent = new Intent ( this , DayDataActivity. class ) ;

String message = "" + calender [ 33 ] . day + "," + ( monthCarry + 1 ) + "," + yearCarry ;

intent. putExtra ( DATE, message ) ;

startActivity ( intent ) ;

}

public void b35Pressed ( View view ) {

Intent intent = new Intent ( this , DayDataActivity. class ) ;

String message = "" + calender [ 34 ] . day + "," + ( monthCarry + 1 ) + "," + yearCarry ;

intent. putExtra ( DATE, message ) ;

startActivity ( intent ) ;

}

public void b36Pressed ( View view ) {

Intent intent = new Intent ( this , DayDataActivity. class ) ;

String message = "" + calender [ 35 ] . day + "," + ( monthCarry + 1 ) + "," + yearCarry ;

intent. putExtra ( DATE, message ) ;

startActivity ( intent ) ;

}

public void b37Pressed ( View view ) {

Intent intent = new Intent ( this , DayDataActivity. class ) ;

String message = "" + calender [ 36 ] . day + "," + ( monthCarry + 1 ) + "," + yearCarry ;

intent. putExtra ( DATE, message ) ;

startActivity ( intent ) ;

}

public void b38Pressed ( View view ) {

Intent intent = new Intent ( this , DayDataActivity. class ) ;

String message = "" + calender [ 37 ] . day + "," + ( monthCarry + 1 ) + "," + yearCarry ;

intent. putExtra ( DATE, message ) ;

startActivity ( intent ) ;

}

public void b39Pressed ( View view ) {

Intent intent = new Intent ( this , DayDataActivity. class ) ;

String message = "" + calender [ 38 ] . day + "," + ( monthCarry + 1 ) + "," + yearCarry ;

intent. putExtra ( DATE, message ) ;

startActivity ( intent ) ;

}

public void bPrevPressed ( View view ) {

if ( monthCarry == 0 )

{

yearCarry = yearCarry - 1 ;

monthCarry = 11 ;

} else {

monthCarry = monthCarry - 1 ;

}

Clear ( ) ;

foward = false ;

loadCalender ( ) ;

}

public void bNextPressed ( View view ) {

if ( monthCarry == 11 )

{

yearCarry = yearCarry + 1 ;

monthCarry = 0 ;

} else {

monthCarry = monthCarry + 1 ;

}

Clear ( ) ;

foward = true ;

loadCalender ( ) ;

}

public void Clear ( )

{

Button button ;

button = ( Button ) findViewById ( R. id . b1 ) ;

button. setText ( "" ) ;

button. setVisibility ( View . INVISIBLE ) ;

button. setBackgroundColor ( Color . parseColor ( "#BDBDBD" ) ) ;

button = ( Button ) findViewById ( R. id . b2 ) ;

button. setText ( "" ) ;

button. setVisibility ( View . INVISIBLE ) ;

button. setBackgroundColor ( Color . parseColor ( "#BDBDBD" ) ) ;

button = ( Button ) findViewById ( R. id . b3 ) ;

button. setText ( "" ) ;

button. setVisibility ( View . INVISIBLE ) ;

button. setBackgroundColor ( Color . parseColor ( "#BDBDBD" ) ) ;

button = ( Button ) findViewById ( R. id . b4 ) ;

button. setText ( "" ) ;

button. setVisibility ( View . INVISIBLE ) ;

button. setBackgroundColor ( Color . parseColor ( "#BDBDBD" ) ) ;

button = ( Button ) findViewById ( R. id . b5 ) ;

button. setText ( "" ) ;

button. setVisibility ( View . INVISIBLE ) ;

button. setBackgroundColor ( Color . parseColor ( "#BDBDBD" ) ) ;

button = ( Button ) findViewById ( R. id . b6 ) ;

button. setText ( "" ) ;

button. setVisibility ( View . INVISIBLE ) ;

button. setBackgroundColor ( Color . parseColor ( "#BDBDBD" ) ) ;

button = ( Button ) findViewById ( R. id . b7 ) ;

button. setText ( "" ) ;

button. setVisibility ( View . INVISIBLE ) ;

button. setBackgroundColor ( Color . parseColor ( "#BDBDBD" ) ) ;

button = ( Button ) findViewById ( R. id . b8 ) ;

button. setText ( "" ) ;

button. setVisibility ( View . INVISIBLE ) ;

button. setBackgroundColor ( Color . parseColor ( "#BDBDBD" ) ) ;

button = ( Button ) findViewById ( R. id . b9 ) ;

button. setText ( "" ) ;

button. setVisibility ( View . INVISIBLE ) ;

button. setBackgroundColor ( Color . parseColor ( "#BDBDBD" ) ) ;

button = ( Button ) findViewById ( R. id . b10 ) ;

button. setText ( "" ) ;

button. setVisibility ( View . INVISIBLE ) ;

button. setBackgroundColor ( Color . parseColor ( "#BDBDBD" ) ) ;

button = ( Button ) findViewById ( R. id . b11 ) ;

button. setText ( "" ) ;

button. setVisibility ( View . INVISIBLE ) ;

button. setBackgroundColor ( Color . parseColor ( "#BDBDBD" ) ) ;

button = ( Button ) findViewById ( R. id . b12 ) ;

button. setText ( "" ) ;

button. setVisibility ( View . INVISIBLE ) ;

button. setBackgroundColor ( Color . parseColor ( "#BDBDBD" ) ) ;

button = ( Button ) findViewById ( R. id . b13 ) ;

button. setText ( "" ) ;

button. setVisibility ( View . INVISIBLE ) ;

button. setBackgroundColor ( Color . parseColor ( "#BDBDBD" ) ) ;

button = ( Button ) findViewById ( R. id . b14 ) ;

button. setText ( "" ) ;

button. setVisibility ( View . INVISIBLE ) ;

button. setBackgroundColor ( Color . parseColor ( "#BDBDBD" ) ) ;

button = ( Button ) findViewById ( R. id . b15 ) ;

button. setText ( "" ) ;

button. setVisibility ( View . INVISIBLE ) ;

button. setBackgroundColor ( Color . parseColor ( "#BDBDBD" ) ) ;

button = ( Button ) findViewById ( R. id . b16 ) ;

button. setText ( "" ) ;

button. setVisibility ( View . INVISIBLE ) ;

button. setBackgroundColor ( Color . parseColor ( "#BDBDBD" ) ) ;

button = ( Button ) findViewById ( R. id . b17 ) ;

button. setText ( "" ) ;

button. setVisibility ( View . INVISIBLE ) ;

button. setBackgroundColor ( Color . parseColor ( "#BDBDBD" ) ) ;

button = ( Button ) findViewById ( R. id . b18 ) ;

button. setText ( "" ) ;

button. setVisibility ( View . INVISIBLE ) ;

button. setBackgroundColor ( Color . parseColor ( "#BDBDBD" ) ) ;

button = ( Button ) findViewById ( R. id . b19 ) ;

button. setText ( "" ) ;

button. setVisibility ( View . INVISIBLE ) ;

button. setBackgroundColor ( Color . parseColor ( "#BDBDBD" ) ) ;

button = ( Button ) findViewById ( R. id . b20 ) ;

button. setText ( "" ) ;

button. setVisibility ( View . INVISIBLE ) ;

button. setBackgroundColor ( Color . parseColor ( "#BDBDBD" ) ) ;

button = ( Button ) findViewById ( R. id . b21 ) ;

button. setText ( "" ) ;

button. setVisibility ( View . INVISIBLE ) ;

button. setBackgroundColor ( Color . parseColor ( "#BDBDBD" ) ) ;

button = ( Button ) findViewById ( R. id . b22 ) ;

button. setText ( "" ) ;

button. setVisibility ( View . INVISIBLE ) ;

button. setBackgroundColor ( Color . parseColor ( "#BDBDBD" ) ) ;

button = ( Button ) findViewById ( R. id . b23 ) ;

button. setText ( "" ) ;

button. setVisibility ( View . INVISIBLE ) ;

button. setBackgroundColor ( Color . parseColor ( "#BDBDBD" ) ) ;

button = ( Button ) findViewById ( R. id . b24 ) ;

button. setText ( "" ) ;

button. setVisibility ( View . INVISIBLE ) ;

button. setBackgroundColor ( Color . parseColor ( "#BDBDBD" ) ) ;

button = ( Button ) findViewById ( R. id . b25 ) ;

button. setText ( "" ) ;

button. setVisibility ( View . INVISIBLE ) ;

button. setBackgroundColor ( Color . parseColor ( "#BDBDBD" ) ) ;

button = ( Button ) findViewById ( R. id . b26 ) ;

button. setText ( "" ) ;

button. setVisibility ( View . INVISIBLE ) ;

button. setBackgroundColor ( Color . parseColor ( "#BDBDBD" ) ) ;

button = ( Button ) findViewById ( R. id . b27 ) ;

button. setText ( "" ) ;

button. setVisibility ( View . INVISIBLE ) ;

button. setBackgroundColor ( Color . parseColor ( "#BDBDBD" ) ) ;

button = ( Button ) findViewById ( R. id . b28 ) ;

button. setText ( "" ) ;

button. setVisibility ( View . INVISIBLE ) ;

button. setBackgroundColor ( Color . parseColor ( "#BDBDBD" ) ) ;

button = ( Button ) findViewById ( R. id . b29 ) ;

button. setText ( "" ) ;

button. setVisibility ( View . INVISIBLE ) ;

button. setBackgroundColor ( Color . parseColor ( "#BDBDBD" ) ) ;

button = ( Button ) findViewById ( R. id . b30 ) ;

button. setText ( "" ) ;

button. setVisibility ( View . INVISIBLE ) ;

button. setBackgroundColor ( Color . parseColor ( "#BDBDBD" ) ) ;

button = ( Button ) findViewById ( R. id . b31 ) ;

button. setText ( "" ) ;

button. setVisibility ( View . INVISIBLE ) ;

button. setBackgroundColor ( Color . parseColor ( "#BDBDBD" ) ) ;

button = ( Button ) findViewById ( R. id . b32 ) ;

button. setText ( "" ) ;

button. setVisibility ( View . INVISIBLE ) ;

button. setBackgroundColor ( Color . parseColor ( "#BDBDBD" ) ) ;

button = ( Button ) findViewById ( R. id . b33 ) ;

button. setText ( "" ) ;

button. setVisibility ( View . INVISIBLE ) ;

button. setBackgroundColor ( Color . parseColor ( "#BDBDBD" ) ) ;

button = ( Button ) findViewById ( R. id . b34 ) ;

button. setText ( "" ) ;

button. setVisibility ( View . INVISIBLE ) ;

button. setBackgroundColor ( Color . parseColor ( "#BDBDBD" ) ) ;

button = ( Button ) findViewById ( R. id . b35 ) ;

button. setText ( "" ) ;

button. setVisibility ( View . INVISIBLE ) ;

button. setBackgroundColor ( Color . parseColor ( "#BDBDBD" ) ) ;

button = ( Button ) findViewById ( R. id . b36 ) ;

button. setText ( "" ) ;

button. setVisibility ( View . INVISIBLE ) ;

button. setBackgroundColor ( Color . parseColor ( "#BDBDBD" ) ) ;

button = ( Button ) findViewById ( R. id . b37 ) ;

button. setText ( "" ) ;

button. setVisibility ( View . INVISIBLE ) ;

button. setBackgroundColor ( Color . parseColor ( "#BDBDBD" ) ) ;

button = ( Button ) findViewById ( R. id . b38 ) ;

button. setText ( "" ) ;

button. setVisibility ( View . INVISIBLE ) ;

button. setBackgroundColor ( Color . parseColor ( "#BDBDBD" ) ) ;

button = ( Button ) findViewById ( R. id . b39 ) ;

button. setText ( "" ) ;

button. setVisibility ( View . INVISIBLE ) ;

button. setBackgroundColor ( Color . parseColor ( "#BDBDBD" ) ) ;

button = ( Button ) findViewById ( R. id . b40 ) ;

button. setText ( "" ) ;

button. setVisibility ( View . INVISIBLE ) ;

button. setBackgroundColor ( Color . parseColor ( "#BDBDBD" ) ) ;

button = ( Button ) findViewById ( R. id . b41 ) ;

button. setText ( "" ) ;

button. setVisibility ( View . INVISIBLE ) ;

button. setBackgroundColor ( Color . parseColor ( "#BDBDBD" ) ) ;

button = ( Button ) findViewById ( R. id . b42 ) ;

button. setText ( "" ) ;

button. setVisibility ( View . INVISIBLE ) ;

button. setBackgroundColor ( Color . parseColor ( "#BDBDBD" ) ) ;

ImageView image = ( ImageView ) findViewById ( R. id . CalP1 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalP2 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalP3 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalP4 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalP5 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalP6 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalP7 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalP8 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalP9 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalP10 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalP11 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalP12 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalP13 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalP14 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalP15 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalP16 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalP17 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalP18 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalP19 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalP20 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalP21 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalP22 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalP23 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalP24 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalP25 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalP26 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalP27 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalP28 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalP29 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalP30 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalP31 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalP32 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalP33 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalP34 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalP35 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalP36 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalP37 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalP38 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalP39 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalP40 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalP41 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalP42 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG1 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG2 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG3 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG4 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG5 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG6 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG7 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG8 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG9 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG10 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG11 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG12 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG13 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG14 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG15 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG16 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG17 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG18 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG19 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG20 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG21 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG22 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG23 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG24 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG25 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG26 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG27 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG28 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG29 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG30 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG31 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG32 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG33 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG34 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG35 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG36 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG37 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG38 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG39 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG40 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG41 ) ;

image. setVisibility ( View . INVISIBLE ) ;

image = ( ImageView ) findViewById ( R. id . CalG42 ) ;

image. setVisibility ( View . INVISIBLE ) ;

}