Somebody please help me to my problem. I'm currently developing mobile grocery app for my thesis. I used to make more buttons because I'm beginner, and using buttons is much simplest way to make the app. I just want here to make the output in other layout, just like summary of all item bought. By the way I used checkbox to determined what might item you will buy. So here's the code.

Baby\_Items (Grocery Category) Serves as a parent button
========================================================

```
public class Baby_Items extends ActionBarActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_baby__items);
}

public void baby_diaper (View view) {
    Intent i = new Intent(this, Baby_Diaper.class);
    startActivity(i);
}

public void baby_food (View view) {
    Intent i = new Intent(this, Baby_Food.class);
    startActivity(i);
}

public void baby_milk (View view) {
    Intent i = new Intent(this, Baby_Milk.class);
    startActivity(i);
}

```

Baby\_Diaper (Children button)
==============================

```
public class Baby_Diaper extends ActionBarActivity {
ArrayList<String> selection = new ArrayList<String>();
TextView final_text;
Intent i = new Intent(this, Shopping_List.class);

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_baby__diaper);
    final_text = (TextView)findViewById(R.id.final_result_shopping);
    final_text.setEnabled(false);
}

public void SelectItem (View view) {

    boolean checked = ((CheckBox) view) .isChecked();
    switch (view.getId())
    {
        case R.id.pampers:

            if(checked)
            {selection.add("Pampers");}
            else
            {
                selection.remove ("Pampers");
            }
            break;

        case R.id.huggies:

            if(checked)
            {selection.add("Huggies");}
            else
            {
                selection.remove ("Huggies");
            }
            break;

        case R.id.johnsons:

            if(checked)
            {selection.add("Johnsons");}
            else
            {
                selection.remove ("Johnsons");
            }
            break;

        case R.id.supreme:

            if(checked)
            {selection.add("Supreme");}
            else
            {
                selection.remove ("Supreme");
            }
            break;
    }
}

public void addtocart(View view){
    String final_shopping_selection = "";

    for (String Selections  : selection){
        final_shopping_selection = final_shopping_selection + Selections + "\n";
    }

    final_text.setText(final_shopping_selection);
    final_text.setEnabled(true);
}

```

Baby Item XML
=============

```
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context="com.example.admin.mobile_grocery.Baby_Items"
android:id="@+id/baby_items">

<ImageButton
    android:layout_width="100dp"
    android:layout_height="100dp"
    android:id="@+id/diapers"
    android:src="@drawable/cloth_diaper_pic"
    android:scaleType="centerCrop"
    android:layout_alignParentTop="true"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"
    android:onClick="baby_diaper" />

<ImageButton
    android:layout_width="100dp"
    android:layout_height="100dp"
    android:id="@+id/baby_food"
    android:layout_alignParentTop="true"
    android:layout_centerHorizontal="true"
    android:src="@drawable/baby_food"
    android:scaleType="centerCrop"

    android:onClick="baby_food" />

<ImageButton
    android:layout_width="100dp"
    android:layout_height="100dp"
    android:id="@+id/baby_milk"
    android:layout_alignParentTop="true"
    android:layout_alignParentRight="true"
    android:layout_alignParentEnd="true"
    android:src="@drawable/milk"
    android:scaleType="centerCrop"
    android:onClick="baby_milk" />

```

Baby\_Diaper XML
================

```
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context="com.example.admin.mobile_grocery.Baby_Diaper"
android:id="@+id/baby_diaper">

<CheckBox
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/pampers"
    android:id="@+id/pampers"
    android:layout_alignParentTop="true"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"
    android:layout_marginTop="52dp"
    android:checked="false"
    android:onClick="SelectItem" />

<CheckBox
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/huggies"
    android:id="@+id/huggies"
    android:layout_below="@+id/pampers"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"
    android:checked="false"
    android:onClick="SelectItem" />

<CheckBox
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/johnsons"
    android:id="@+id/johnsons"
    android:layout_below="@+id/huggies"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"
    android:checked="false"
    android:onClick="SelectItem"
    android:inputType="textNoSuggestions"
    />

<CheckBox
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/supreme"
    android:id="@+id/supreme"
    android:layout_below="@+id/johnsons"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"
    android:checked="false"
    android:onClick="SelectItem"
    android:inputType="textNoSuggestions"
    />

<Button
    style="?android:attr/buttonStyleSmall"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/addtocart"
    android:id="@+id/addtocart"
    android:layout_alignParentTop="true"
    android:layout_alignParentRight="true"
    android:layout_alignParentEnd="true"
    android:onClick="ocaddtocart"
    android:inputType="textNoSuggestions"
    />

```

Shopping List XML (I want to summary all items here in shopping list activity)
==============================================================================

```
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context="com.example.admin.mobile_grocery.Shopping_List"
android:id="@+id/shopping_list_layout">

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:text="Shopping List"
    android:id="@+id/shopping_list"
    android:layout_alignParentTop="true"
    android:layout_centerHorizontal="true" />

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Hello Shoppers!"
    android:id="@+id/final_result_shopping"
    android:layout_marginTop="33dp"
    android:layout_below="@+id/reservation_list"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true" />

```

Shopping List Java
==================

> 
> No code added
> 
> 
> 

Manifest
========

```
<?xml version="1.0" encoding="utf-8"?>

```

```
<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".Mobile_Grocery"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name=".Login"
        android:label="@string/title_activity_login" >
    </activity>
    <activity
        android:name=".Baby_Items"
        android:label="@string/title_activity_baby__items" >
    </activity>
    <activity
        android:name=".Baking"
        android:label="@string/title_activity_baking" >
    </activity>
    <activity
        android:name=".Beverages"
        android:label="@string/title_activity_beverages" >
    </activity>
    <activity
        android:name=".Bakery"
        android:label="@string/title_activity_bakery" >
    </activity>
    <activity
        android:name=".Canned_Goods"
        android:label="@string/title_activity_canned__goods" >
    </activity>
    <activity
        android:name=".Condiments"
        android:label="@string/title_activity_condiments" >
    </activity>
    <activity
        android:name=".Dairy"
        android:label="@string/title_activity_dairy" >
    </activity>
    <activity
        android:name=".Frozen_Foods"
        android:label="@string/title_activity_frozen__foods" >
    </activity>
    <activity
        android:name=".Miscellaneous"
        android:label="@string/title_activity_miscellaneous" >
    </activity>
    <activity
        android:name=".Non_Food_Items"
        android:label="@string/title_activity_non__food__items" >
    </activity>
    <activity
        android:name=".Pasta_Rice"
        android:label="@string/title_activity_pasta__rice" >
    </activity>
    <activity
        android:name=".Snacks"
        android:label="@string/title_activity_snacks" >
    </activity>
    <activity
        android:name=".Baby_Diaper"
        android:label="@string/title_activity_baby__diaper" >
    </activity>
    <activity
        android:name=".Baby_Food"
        android:label="@string/title_activity_baby__food" >
    </activity>
    <activity
        android:name=".Baby_Milk"
        android:label="@string/title_activity_baby__milk" >
    </activity>
    <activity
        android:name=".Bakery_Bread"
        android:label="@string/title_activity_bakery__bread" >
    </activity>
    <activity
        android:name=".Bakery_Cake"
        android:label="@string/title_activity_bakery__cake" >
    </activity>
    <activity
        android:name=".Bakery_Cookies"
        android:label="@string/title_activity_bakery__cookies" >
    </activity>
    <activity
        android:name=".Bakery_Donut"
        android:label="@string/title_activity_bakery__donut" >
    </activity>

    <activity
        android:name=".Bakery_Muffins"
        android:label="@string/title_activity_bakery__muffins" >
    </activity>
    <activity
        android:name=".Bakery_Pie"
        android:label="@string/title_activity_bakery__pie" >
    </activity>
    <activity
        android:name=".Beverages_Coffee"
        android:label="@string/title_activity_beverages__coffee" >
    </activity>
    <activity
        android:name=".Beverages_Juice"
        android:label="@string/title_activity_beverages__juice" >
    </activity>
    <activity
        android:name=".Beverages_Soda"
        android:label="@string/title_activity_beverages__soda" >
    </activity>
    <activity
        android:name=".Beverages_Tea"
        android:label="@string/title_activity_beverages__tea" >
    </activity>
    <activity
        android:name=".Beverages_Water"
        android:label="@string/title_activity_beverages__water" >
    </activity>
    <activity
        android:name=".Baking_Flour"
        android:label="@string/title_activity_baking__flour" >
    </activity>
    <activity
        android:name=".Baking_Icing"
        android:label="@string/title_activity_baking__icing" >
    </activity>
    <activity
        android:name=".Baking_Sugar"
        android:label="@string/title_activity_baking__sugar" >
    </activity>
    <activity
        android:name=".Canned_Goods_Fruits_And_Veggies"
        android:label="@string/title_activity_canned__goods__fruits__and__veggies" >
    </activity>
    <activity
        android:name=".Canned_Goods_Sauces"
        android:label="@string/title_activity_canned__goods__sauces" >
    </activity>
    <activity
        android:name=".Canned_Goods_Tuna"
        android:label="@string/title_activity_canned__goods__tuna" >
    </activity>
    <activity
        android:name=".Condiments_Ketchup"
        android:label="@string/title_activity_condiments__ketchup" >
    </activity>
    <activity
        android:name=".Condiments_Mustard"
        android:label="@string/title_activity_condiments__mustard" >
    </activity>
    <activity
        android:name=".Condiments_Soy_Sauce"
        android:label="@string/title_activity_condiments__soy__sauce" >
    </activity>
    <activity
        android:name=".Condiments_Vinegar"
        android:label="@string/title_activity_condiments__vinegar" >
    </activity>
    <activity
        android:name=".Dairy_Cheese"
        android:label="@string/title_activity_dairy__cheese" >
    </activity>
    <activity
        android:name=".Dairy_dairymilk"
        android:label="@string/title_activity_dairy_dairymilk" >
    </activity>
    <activity
        android:name=".Dairy_Egg"
        android:label="@string/title_activity_dairy__egg" >
    </activity>
    <activity
        android:name=".Frozen_Food_Ice_Cream"
        android:label="@string/title_activity_frozen__food__ice__cream" >
    </activity>
    <activity
        android:name=".Miscellaneous_Battery"
        android:label="@string/title_activity_miscellaneous__battery" >
    </activity>
    <activity
        android:name=".Non_Food_Items_Liquid_Detergent"
        android:label="@string/title_activity_non__food__items__liquid__detergent" >
    </activity>
    <activity
        android:name=".Non_Food_Items_Dishwashing_Liquid"
        android:label="@string/title_activity_non__food__items__dishwashing__liquid" >
    </activity>
    <activity
        android:name=".Non_Food_Items_Plates_n_Cups"
        android:label="@string/title_activity_non__food__items__plates_n__cups" >
    </activity>
    <activity
        android:name=".Non_Food_Items_Soap"
        android:label="@string/title_activity_non__food__items__soap" >
    </activity>
    <activity
        android:name=".Non_Food_Items_Tissue"
        android:label="@string/title_activity_non__food__items__tissue" >
    </activity>
    <activity
        android:name=".Pasta_Rice_Macaroni"
        android:label="@string/title_activity_pasta__rice__macaroni" >
    </activity>
    <activity
        android:name=".Pasta_Rice_Spaghetti"
        android:label="@string/title_activity_pasta__rice__spaghetti" >
    </activity>
    <activity
        android:name=".Pasta_Rice_Rice"
        android:label="@string/title_activity_pasta__rice__rice" >
    </activity>
    <activity
        android:name=".Snacks_Chips"
        android:label="@string/title_activity_snacks__chips" >
    </activity>
    <activity
        android:name=".My_Profile_List"
        android:label="@string/title_activity_my__profile__list" >
    </activity>
    <activity
        android:name=".Shopping_List"
        android:label="@string/title_activity_shopping__list" >
    </activity>
    <activity
        android:name=".Reservation_List"
        android:label="@string/title_activity_reservation__list" >
    </activity>
    <activity
        android:name=".Credit_List"
        android:label="@string/title_activity_credit__list" >
    </activity>
</application>

```

### LOGCAT ERROR ###

```js
  09-30 12:28:10.297    2019-2210/? E/Watchdog﹕ !@Sync 9045
09-30 12:28:37.827    4074-4074/? E/MtpService﹕ In MTPAPP onReceive:android.intent.action.BATTERY_CHANGED
09-30 12:28:37.827    4074-4074/? E/MtpService﹕ battPlugged Type : 2
09-30 12:28:40.297    2019-2210/? E/Watchdog﹕ !@Sync 9046
09-30 12:29:10.302    2019-2210/? E/Watchdog﹕ !@Sync 9047
09-30 12:29:17.812    4074-4074/? E/MtpService﹕ In MTPAPP onReceive:android.intent.action.BATTERY_CHANGED
09-30 12:29:17.812    4074-4074/? E/MtpService﹕ battPlugged Type : 2
09-30 12:29:40.302    2019-2210/? E/Watchdog﹕ !@Sync 9048
09-30 12:29:42.902  24687-24687/? E/dalvikvm﹕ Could not find class 'android.app.Notification$Action$Builder', referenced from method b.a
09-30 12:29:43.032  24687-24687/? E/dalvikvm﹕ Could not find class 'android.graphics.drawable.RippleDrawable', referenced from method b.a
09-30 12:29:43.242  24687-24687/? E/dalvikvm﹕ Could not find class 'android.app.Notification$Action$Builder', referenced from method b.a
09-30 12:29:43.332  24687-24687/? E/dalvikvm﹕ Could not find class 'android.transition.Transition', referenced from method b.a
09-30 12:29:43.332  24687-24687/? E/dalvikvm﹕ Could not find class 'android.transition.Transition', referenced from method b.a
09-30 12:29:43.332  24687-24687/? E/dalvikvm﹕ Could not find class 'android.transition.Transition', referenced from method b.a
09-30 12:29:43.407  24687-24687/? E/dalvikvm﹕ Could not find class 'android.app.RemoteInput[]', referenced from method b.a
09-30 12:29:43.442  24687-24687/? E/dalvikvm﹕ Could not find class 'android.transition.Transition', referenced from method b.b
09-30 12:29:57.947    4074-4074/? E/MtpService﹕ In MTPAPP onReceive:android.intent.action.BATTERY_CHANGED
09-30 12:29:57.947    4074-4074/? E/MtpService﹕ battPlugged Type : 2
09-30 12:30:10.307    2019-2210/? E/Watchdog﹕ !@Sync 9049
```