title: Android OnActivityResult passing data to another form and getting array result from it
body: <p>I want to send some Data to another activity say SecondActivity and then getting Array data from That SecondActivity to Main activity using OnActivityResult</p>
  
  <p>This is a app like when i press upload button i already have path i want to send that path to another activity and then getting the result in array from another activity to same mainactivity and then want to view that array in textview</p>
  
  <p>CSVUpload</p>
  
  <pre><code>public class CSVUploader extends Activity {
      Button btnUpload;
      EditText txtName;
      EditText txtMessageName;
      Bundle extras = getIntent().getExtras();
      String FullPath = extras.getString("FullPath");
      @Override
      protected void onCreate(Bundle savedInstanceState) {
  
      try{
      File csvfile = new File(FullPath);
      FileInputStream csvStream = new FileInputStream(csvfile);
      BufferedReader in = new BufferedReader(new InputStreamReader(csvStream));
      String line;
      String[] name = null;
      String[] number = null;
      int iCount=0;
              while ((line = in.readLine()) != null){
                  String[] RowData = line.split(",");
                  name[iCount] = RowData[0];
                  number[iCount] = RowData[1];
                  iCount++;
  /*                  ContentValues values = new ContentValues();
                  values.put(key, value);
                  values.put(CsvProvider.NUMBER, number);
                  values.put("status",status);
                  getContentResolver().insert(CsvProvider.CONTENT_URI, values);
  */              }
              in.close();
              Bundle b =new Bundle();
              Intent intent = new Intent();
              b.putStringArray("name", name);
              b.putStringArray("number", number);
              intent.putExtras(b);
              setResult(RESULT_OK, intent);
              finish();
  
  
      }
      catch(Exception e)
      {
          e.printStackTrace();
      }
      }
  
  }
  </code></pre>
  
  <p>FirstActivity</p>
  
  <pre><code>  public void uploadfile(View view){
          edittext = (EditText)findViewById(R.id.txtFile);
          Toast.makeText(NewMessage.this, FullPath, 2000).show();
          if(FullPath != null)
          {
          Intent intent1 = new Intent(this, CSVUploader.class);
          intent1.putExtra("FullPath", FullPath);
          startActivityForResult(intent1, 2);     
          }
          else
          {
              Toast.makeText(NewMessage.this, "No File Selected", 2000).show();
          }
      }
  
   // Listen for results.
      public void onActivityResult(int requestCode, int resultCode, Intent data){
          // See which child activity is calling us back.
          super.onActivityResult(requestCode, resultCode, data);
  
  
          if (requestCode == REQUEST_PATH){
                  if (resultCode == RESULT_OK) { 
                      curPathName = data.getStringExtra("GetPath"); 
                      curFileName = data.getStringExtra("GetFileName");
                      FullPath = curPathName+"/"+curFileName;
                      edittext.setText(curFileName);
      /*              Toast.makeText(NewMessage.this, resId, duration);*/
                  }
               }
  
          if (requestCode==2){
              if (resultCode == RESULT_OK) {
                  Bundle b=this.getIntent().getExtras();
                  String[] name=b.getStringArray("name");
                  String[] number=b.getStringArray("number");
                  String[] status;
              }
          }
  </code></pre>