title: Why startActivityForResult not working?
body: <p>I'm using <code>startActivityForResult</code> to return value from <strong>Activity B</strong> to <strong>Activity A</strong>. But when the save <code>button</code> in <strong>B</strong> is clicked, it does not back to <strong>Activity A</strong>.  Can someone help me to figure out the problem ?</p>
  
  <p><strong>Activity B</strong></p>
  
  <pre><code>  save.setOnClickListener(new View.OnClickListener()
          {  // return values to previous activity
              @Override
              public void onClick(View v)
              {
                  Intent returnIntent=new Intent();
                  Project=project.getSelectedItem().toString();
                  Description=description.getText().toString();
                  progress=seekBar.getProgress();
                  returnIntent.putExtra("Project",Project);
                  returnIntent.putExtra("Description", Description);
                 returnIntent.putExtra("progress",progress);
                  returnIntent.putExtra("TimeIn", TimeIn);
                  returnIntent.putExtra("TimeOut",TimeOut);
                  setResult(Activity.RESULT_OK,returnIntent);
                  Log.e("d","d");
  
              }
          });
  </code></pre>
  
  <p><strong>Activity A</strong></p>
  
  <pre><code>     public static final int PROJECT_REQUEST_CODE = 1;
        public static final int CAMERA_REQUEST_CODE = 2;
  
    @Override
      public boolean onOptionsItemSelected(MenuItem item) {
          switch (item.getItemId()) {
              case R.id.addDetails:
                  View menuItemView = findViewById(R.id.addDetails); 
                  PopupMenu po = new PopupMenu(this, menuItemView); //for drop-down menu
                  po.getMenuInflater().inflate(R.menu.popup_details, po.getMenu());
                  po.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
                      public boolean onMenuItemClick(MenuItem item) {
                          Toast.makeText(getApplication(), "You Clicked : " + item.getTitle(), Toast.LENGTH_SHORT).show();
                          if ("Add Work Details".equals(item.getTitle())) {
                              Intent intent = new Intent(getApplication(), Add_Details_Information.class);  // go to B
                              startActivityForResult(intent, PROJECT_REQUEST_CODE);
                          }
                          return true;
                      }
                  });
                  po.show(); //showing popup menu
          }
          return super.onOptionsItemSelected(item);
  
      }
  
          @Override
          public void onActivityResult(int requestCode, int resultCode, Intent data) { // receive from B
             if(requestCode==PROJECT_REQUEST_CODE)
             {
                      ReceiveProject = data.getStringExtra("Project");
                      ReceiveDescription = data.getStringExtra("Description");
                      ReceiveProgress = data.getStringExtra("progress");
                      ReceiveTimeIn = data.getStringExtra("TimeIn");
                      ReceiveTimeOut = data.getStringExtra("TimeOut");
  
                      ArrayList&lt;SearchResults&gt; searchResults = GetSearchResults(weather, date, status, ReceiveTimeIn, ReceiveTimeOut);
                      listview.setAdapter(new MyCustomBaseAdapter(this,searchResults));
              }
              else if(requestCode==CAMERA_REQUEST_CODE)
             {
  
             }
          }
  </code></pre>