title: Passing String Array to another class using Intents
body: <p>Actually I have two ACTIVITIES namely MainActivity and ListVIew .<br>
  I want to pass this String array "arr" from MainActivity to ListVIew ..<br>
  And the Activity ListVIew will show the List of elements of "arr"    </p>
  
  <p>Note: The data in arr is supplied from a database created by me , and it works fine .   </p>
  
  <p>There is some issue with retrieving of the arr in Activity ListView </p>
  
  <p><strong>MainActivity</strong></p>
  
  <pre><code>package com.vivekmishra1991.database;
  
  import android.content.Context;
  import android.content.Intent;
  import android.database.Cursor;
  import android.os.Bundle;
  import android.app.Activity;
  import android.view.Menu;
  import android.view.View;
  import android.widget.ArrayAdapter;
  import android.widget.Button;
  import android.widget.ListView;
  import android.widget.TextView;
  
  public class MainActivity extends Activity {
  public int i;
  
  public String arr[] = new String[100];
  
  
   private DatabaseHelper databaseHelper;
   @Override
    protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      // A clickable TextView 
  
      final TextView textView=(TextView) findViewById(R.id.savedContent);
     textView.setOnClickListener(new View.OnClickListener() {
         public void onClick(View view) {
  
  
              &lt;--ARRAY(arr) RETRIVED FROM DATABASE--&gt;
  
  
  
            Intent intent=new Intent(MainActivity.this,ListVIew.class);
             intent.putExtra("array",arr);
            startActivity(intent);
  
  
   }
     });
  
  
   }  // onCreate ends here
  
  
  
  }
  </code></pre>
  
  <p><strong>ListView</strong></p>
  
  <pre><code>  &lt;-imports-&gt;
  
  public class ListVIew extends Activity {
  ListView listview;
  Intent intent=getIntent();
  String[] arr=intent.getStringArrayExtra("array");
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.view_list);
  
  
  
  
  
  
  listview.findViewById(R.id.list);
       ArrayAdapter&lt;String&gt; Adapter = new ArrayAdapter&lt;String&gt;        (this,android.R.layout.simple_list_item_1,arr);
      listview.setAdapter(Adapter);
  }
  </code></pre>
  
  <p>}</p>