title: how to display listview in emulator using sqlite?
body: <p>I have to create sqlite database and values are display in logcat. My issue is I want to display ListView in emulator.I attach my code here, refer to it.</p>
  
  <p>public class AndroidSQLiteTutorialActivity extends ListActivity{</p>
  
  <pre><code>private static final String KEY_ID = "company_id";
  private static final String KEY_NAME = "company_name";
  private static final String KEY_DESC = "company_desc";
  
  public static ArrayList&lt;String&gt; ArrayofName = new ArrayList&lt;String&gt;();
  
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);
  
  
      DatabaseHandler db = new DatabaseHandler(this);
  
      /**
       * CRUD Operations
       * */
      // Inserting Contacts
      Log.d("Insert: ", "Inserting ..");
      db.addContact(new Contact("GNTS Technologies pvt ltd", "Software Company"));
      //db.addContact(new Contact("HCL","Hardware","Inactive"));
     // db.addContact(new Contact("Srinivas", "9199999999"));
      //db.addContact(new Contact("Tommy", "9522222222"));
      //db.addContact(new Contact("Karthik", "9533333333"));
  
      // Reading all contacts
      Log.d("Reading: ", "Reading all contacts..");
      List&lt;Contact&gt; contacts = db.getAllContacts();       
  
      for (Contact cn : contacts) {
          String log = "company_id: "+cn.getID()+" ,company_name: " + cn.getName() + " ,company_desc: " + cn.getDesc();
              // Writing Contacts to log
      Log.d("Name: ", log);
      db.getAllContacts();
  
      }
  
  
  
     ListView lv = (ListView) findViewById(R.id.listView);
  
  
      ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this,
              android.R.layout.activity_list_item, ArrayofName);
  
      setListAdapter(adapter);
  
      lv.setOnItemClickListener(new OnItemClickListener() {
  
  
         public void onItemClick(AdapterView&lt;?&gt; parent,View view,
             int position, long id) {
  
              String company_desc = ((TextView) view
                      .findViewById(R.id.company_desc)).getText().toString();
              String company_id = ((TextView) view
                      .findViewById(R.id.company_id)).getText().toString();
              String company_name = ((TextView) view
                      .findViewById(R.id.company_name)).getText().toString();
  
             Toast.makeText(getApplicationContext(),
              ((TextView) view).getText(), Toast.LENGTH_SHORT).show();
          }
  
     });
  }}
  </code></pre>