title: Android: is it possible to startActivity from another class
body: <p>Here is my code: </p>
  
  <p>Class calendar_list</p>
  
  <pre><code>        new list_view().next(pk[position],maintype[position],this);     
  </code></pre>
  
  <p>Class list_view</p>
  
  <pre><code>public void next(int pk,int type,Context ct){
      Intent intent = null;
  
      if(type==1)
          intent = new Intent(ct,text_eachview.class);    
      else if(type==2)
          intent = new Intent(ct,pic_eachview.class);
      else if(type==3)
          intent = new Intent(ct,video_eachview.class);
      else if(type==4)  
          intent = new Intent(ct,voice_eachview.class);
  
      intent.putExtra("ID",pk);
      startActivity(intent);
      }
  }
  </code></pre>
  
  <p>My code doesn't work, I want to know why? Is this possible?</p>
  
  <p>Thanks.</p>
  
  <p><img src="https://i.stack.imgur.com/ie5um.jpg" alt="enter image description here"></p>