title: How to implement time square calendar app
body: <p>the link to the calendar app is <a href="https://github.com/square/android-times-square#usage" rel="nofollow">https://github.com/square/android-times-square#usage</a></p>
  
  <p>I'm trying to just simply implement this calendar app into my project, and I've been having the hardest time. I put the code into my main activity xml like it told me </p>
  
  <pre><code>&lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:id="@+id/container"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  tools:context="com.example.chexity.MainActivity"
  tools:ignore="MergeRootFrame" &gt;
  
  &lt;com.squareup.timessquare.CalendarPickerView
      android:id="@+id/calendar_view"
      android:layout_width="match_parent"
      android:layout_height="match_parent" /&gt;
  
  &lt;/FrameLayout&gt;
  </code></pre>
  
  <p>and also put the code into my main activity's onCreate</p>
  
  <pre><code>package com.example.chexity;
  
  import java.util.Calendar;
  import java.util.Date;
  import android.support.v7.app.ActionBarActivity;
  import android.support.v7.app.ActionBar;
  import android.support.v4.app.Fragment;
  import android.app.Activity;
  import android.os.Bundle;
  import android.view.LayoutInflater;
  import android.view.Menu;
  import android.view.MenuItem;
  import android.view.View;
  import android.view.ViewGroup;
  import android.os.Build;
  
  public class MainActivity extends Activity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          Calendar nextYear = Calendar.getInstance();
          nextYear.add(Calendar.YEAR, 1);
  
          CalendarPickerView calendar = (CalendarPickerView) findViewById(R.id.calendar_view);
          Date today = new Date();
          calendar.init(today, nextYear.getTime())
              .withSelectedDate(today);
      }
  
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
  
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.main, menu);
          return true;
      }
  
      @Override
      public boolean onOptionsItemSelected(MenuItem item) {
          // Handle action bar item clicks here. The action bar will
          // automatically handle clicks on the Home/Up button, so long
          // as you specify a parent activity in AndroidManifest.xml.
          int id = item.getItemId();
          if (id == R.id.action_settings) {
              return true;
          }
          return super.onOptionsItemSelected(item);
      }
  
      /**
       * A placeholder fragment containing a simple view.
       */
      public static class PlaceholderFragment extends Fragment {
  
          public PlaceholderFragment() {
          }
  
          @Override
          public View onCreateView(LayoutInflater inflater, ViewGroup container,
                  Bundle savedInstanceState) {
              View rootView = inflater.inflate(R.layout.fragment_main, container, false);
              return rootView;
          }
      }
  
  }
  </code></pre>
  
  <p>But I keep getting errors on this line </p>
  
  <pre><code>CalendarPickerView calendar = (CalendarPickerView) findViewById(R.id.calendar_view);
  </code></pre>
  
  <p>and also on the init method.</p>
  
  <p>saying that calendarpickerview cannot be resolved to a type. I imported the library from the the calendar package I downloaded. I don't know what is wrong. Can anyone provide any insight?</p>
  
  <p>I am running on version max 4.4 and min 2.2.</p>