title: Show checked items from dialog box into the previous activity
body: <p>I have a listview of shopping lists in a fragment and when I click one I get a new activity that shows a listview with all the products in the clicked shopping list. What I am trying to do is to add products this list by selecting some checkboxes in the newly created activity and pass them to the previous activity. </p>
  
  <pre><code>public class DisplayShoppingListDetailsActivity extends AppCompatActivity{
      private ShoppingList list;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
  
          //defines the activity layout
          setContentView(R.layout.shopping_list_details);
  
          ListView listView = (ListView) findViewById(R.id.shopping_list_details);
  
          Intent intent = getIntent();
          list = (ShoppingList) intent.getSerializableExtra("ShoppingList");
  
          ProductsOnListAdapter ad = new ProductsOnListAdapter(this, -1, Service.getService().getProductsOnList(list));
          listView.setAdapter(ad);
  
          FloatingActionButton button = (FloatingActionButton) findViewById(R.id.floatingButton);
          button.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  startActivityForResult(new Intent(DisplayShoppingListDetailsActivity.this, ListOfProductsActivity.class));
                  //This method here is not working...it says it cannot resolve the method
              }
          });
  
      }
  </code></pre>