package knorrium.info.myandroidappportfolio;

import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;


public class MainActivity extends ActionBarActivity {

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

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        //noinspection SimplifiableIfStatement
        if (id == R.id.action_settings) {
            return true;
        }

        return super.onOptionsItemSelected(item);
    }
}

@@ -170,16 +170,130 @@
 nuItem;%0A
+import android.view.View;%0Aimport android.widget.Button;%0Aimport android.widget.Toast;%0A%0Aimport java.util.ArrayList;%0A
 %0A%0Apublic
@@ -340,16 +340,57 @@
 ivity %7B%0A
+    private ArrayList%3CButton%3E buttonList;
 %0A    @Ov
@@ -449,24 +449,70 @@
 nceState) %7B%0A
+        buttonList = new ArrayList%3CButton%3E();%0A
         supe
@@ -591,16 +591,2444 @@
 _main);%0A
+%0A        Button btnApp1 = (Button) findViewById(R.id.button);%0A        Button btnApp2 = (Button) findViewById(R.id.button2);%0A        Button btnApp3 = (Button) findViewById(R.id.button3);%0A        Button btnApp4 = (Button) findViewById(R.id.button4);%0A        Button btnApp5 = (Button) findViewById(R.id.button5);%0A        Button btnApp6 = (Button) findViewById(R.id.button6);%0A%0A        buttonList.add(btnApp1);%0A        buttonList.add(btnApp2);%0A        buttonList.add(btnApp3);%0A        buttonList.add(btnApp4);%0A        buttonList.add(btnApp5);%0A        buttonList.add(btnApp6);%0A%0A        for (int i = 0; i %3C buttonList.size(); i++) %7B%0A            buttonList.get(i).setText(buttonList.get(i).getText().toString().toUpperCase());%0A            buttonList.get(i).setOnClickListener(new View.OnClickListener() %7B%0A                @Override%0A                public void onClick(View v)%7B%0A                    String appTitle = new String();%0A                    String toastMsg = new String();%0A                    switch(v.getId())%7B%0A                        case R.id.button:%0A                            appTitle = getString(R.string.main_app1_title);%0A                            break;%0A                        case R.id.button2:%0A                            appTitle = getString(R.string.main_app2_title);%0A                            break;%0A                        case R.id.button3:%0A                            appTitle = getString(R.string.main_app3_title);%0A                            break;%0A                        case R.id.button4:%0A                            appTitle = getString(R.string.main_app4_title);%0A                            break;%0A                        case R.id.button5:%0A                            appTitle = getString(R.string.main_app5_title);%0A                            break;%0A                        case R.id.button6:%0A                            appTitle = getString(R.string.main_app6_title);%0A                            break;%0A                    %7D%0A                    toastMsg = String.format(%0A                            getString(R.string.main_app_toast_message),%0A                            getString(R.string.main_app_launch),%0A                            appTitle,%0A                            getString(R.string.main_app_app)%0A                            );%0A%0A                    Toast.makeText(v.getContext().getApplicationContext(), toastMsg, Toast.LENGTH_SHORT).show();%0A                %7D%0A            %7D);%0A        %7D%0A%0A
     %7D%0A%0A 

implement the buttons click listener to display the toast