title: Closing a view class and opening another view class
body: <p>I call a view class from my activity. Then the view class calls the same activity. Here is the problem, once the activity comes back up, it won't register any more button pushes.(I'm trying to call another view class. Here is some code:</p>
  
  <p>View Class</p>
  
  <pre><code>public class AnimationView extends View {
  
      Activity myActivity;
      //...
      public AnimationView(Context context, Activity activity) {
      super(context);
      //...
      }
  @Override
  protected void onDraw(Canvas canvas) {
      super.onDraw(canvas);
      //...
      myActivity.setContentView(R.layout.activity_home);
      }
  }
  </code></pre>
  
  <p>Home Activity</p>
  
  <pre><code>public class HomeActivity extends AppCompatActivity {
  private AnimationView mDrawViewA;
  ///...
  protected void onCreate(final Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_home);
      mDrawViewA = new AnimationView(this,this);
      start = (Button) findViewById(R.id.startButton);
      //...
      start.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
          //...
          setContentView(mDrawViewA);
          //calls more views 
          //......
      });
  }
  </code></pre>
  
  <p>I realize now maybe I should have been calling the view classes in different activities, but I would very much like a get all the view classes working within the same activity.</p>