title: Using Android AdapterView.OnItemClick Listener to redirect to a new blank activity
body: <p>Hey so I followed a tutorial and constructed a list view. everything is populated and want to click on one of the items and redirect it to another blank activity. All of the items in the list view are made and populated in my Dashboard Class:</p>
  
  <pre><code>    import android.app.AlertDialog;
  import android.content.DialogInterface;
  import android.content.Intent;
  import android.os.Bundle;
  import android.support.v7.app.ActionBarActivity;
  import android.view.Menu;
  import android.view.MenuItem;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.AdapterView;
  import android.widget.ArrayAdapter;
  import android.widget.ImageView;
  import android.widget.ListView;
  import android.widget.TextView;
  import android.widget.Toast;
  
  import java.util.ArrayList;
  import java.util.List;
  
  
  public class Dashboard extends ActionBarActivity {
  
      private List&lt;DashboardItems&gt; myDash = new ArrayList&lt;DashboardItems&gt;();
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_dashboard);
  
          populateDashboardItemList();
          populateDashboardListView();
          dashboardOnclick();
  
      }
  
  
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.menu_dashboard, 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.
          switch (item.getItemId()) {
              case R.id.homescreen:
                  homescreenItem();
                  return true;
              case R.id.dashboard:
                  dashboardItem();
                  return true;
              case R.id.about:
                  aboutItem();
                  return true;
              default:
                  return super.onOptionsItemSelected(item);
          }
      }
  
      private void homescreenItem(){
          startActivity(new Intent(Dashboard.this, Home.class));
      }
  
      private void dashboardItem(){
          startActivity(new Intent(Dashboard.this, Dashboard.class));
      }
  
      private void aboutItem(){
          new AlertDialog.Builder(this)
                  .setTitle("About")
                  .setMessage("Welcome to Save Me! An interactive and intuitive way to protect yourself during emergency situations and keep your location privacy. Made for a Dissertation and Developed by Ankhit Sharma")
                  .setNeutralButton("OK" , new DialogInterface.OnClickListener() {
                      @Override
                      public void onClick(DialogInterface dialog, int which) {
  
                      }
                  }).show();
      }
  
      private void populateDashboardItemList() {
          myDash.add(new DashboardItems("Profile" , "Use this to create/edit your profile" , R.drawable.profile));
          myDash.add(new DashboardItems("Location" , "Use this to set/view your true/dummy location" , R.drawable.location));
          myDash.add(new DashboardItems("Emergency Contacts" , "Use this to select/view your emergency contacts" , R.drawable.contacts));
      }
  
      private void populateDashboardListView() {
          ArrayAdapter&lt;DashboardItems&gt; adapter = new myDashboardAdapter();
          ListView list = (ListView) findViewById(R.id.dashboardListview);
          list.setAdapter(adapter);
      }
  
      private void dashboardOnclick() {
          ListView list = (ListView) findViewById(R.id.dashboardListview);
          list.setOnItemClickListener(new AdapterView.OnItemClickListener(){
  
              @Override
              public void onItemClick(AdapterView&lt;?&gt; parent, View viewClicked, int position, long id) {
  
                  DashboardItems clickedDash = myDash.get(position);
                  String message = "You clicked position" + position
                          + "which is" + clickedDash.getItemName();
                  Toast.makeText(Dashboard.this, message, Toast.LENGTH_LONG).show();
              }
          });
      }
  
      private class myDashboardAdapter extends ArrayAdapter&lt;DashboardItems&gt;{
  
          public myDashboardAdapter(){
              super(Dashboard.this, R.layout.dashboarditemslayout, myDash);
          }
  
          @Override
          public View getView(int position, View convertView, ViewGroup parent) {
             //This makes sure we have a view to work with
              View itemView = convertView;
              if (itemView == null){
                  itemView = getLayoutInflater().inflate(R.layout.dashboarditemslayout, parent, false);
          }
  
             //Find DashboardItem to work with
  
              DashboardItems currentDashboardItems = myDash.get(position);
  
             //Image Icon
              ImageView imageView = (ImageView)itemView.findViewById(R.id.dashboardicon);
              imageView.setImageResource(currentDashboardItems.getItemID());
  
              //Profile
              TextView profView = (TextView)itemView.findViewById(R.id.dashtextprofile);
              profView.setText(currentDashboardItems.getItemName());
  
              //Description
              TextView descView = (TextView)itemView.findViewById(R.id.dashtextprofiledescription);
              descView.setText(currentDashboardItems.getItemDescription());
  
  
             return itemView;
      }
  
  
      }
  }
  </code></pre>
  
  <p>Now in the function OnItemClick I've tried different combinations to get it to reference another class (my UserProfile.java) yet it doesn't work. The current function clicks it and displays the position and respective name of the item along with a message. I was wondering if you could tell me the proper way to start the intent for adapter view as its all fairly new to me? </p>
  
  <p>The UserProfile.java class is a blank activity.    </p>
  
  <p>Ps. whats the main difference between OnItemClick vs. OnClick besides the fact that item is for the item and onClick is the whole area?</p>