package de.cs.fau.mad.quickshop.android.view;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.FrameLayout;

import cs.fau.mad.quickshop_android.R;

/**
 * BaseActivity: all activities have to inherit
 */

public class BaseActivity extends ActionBarActivity {

    public static FrameLayout frameLayout;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        frameLayout = (FrameLayout)findViewById(R.id.content_frame);

        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        getSupportActionBar().setHomeButtonEnabled(true);
    }



    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.overview_action_menu, menu);
        return super.onCreateOptionsMenu(menu);
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {

        switch (item.getItemId()) {
            case R.id.action_settings:
                startActivity(new Intent(this, SettingActivity.class));
                return true;
            case R.id.action_about:
                startActivity(new Intent(this, AboutActivity.class));
                return true;
            case R.id.action_listofshoppinglists:
                startActivity(new Intent(this, ListOfShoppingListsActivity.class));
                return true;

            default:
                return super.onOptionsItemSelected(item);
        }
    }



}

@@ -666,32 +666,34 @@
 frame);%0A%0A       
+//
  getSupportActio
@@ -740,16 +740,18 @@
         
+//
 getSuppo
@@ -787,24 +787,151 @@
 abled(true);
+%0A%0A        getSupportActionBar().setDisplayShowHomeEnabled(true);%0A        getSupportActionBar().setIcon(R.drawable.ic_launcher);
 %0A    %7D%0A%0A%0A%0A  
@@ -1665,16 +1665,157 @@
 rn true;
+%0A            case R.id.home:%0A                startActivity(new Intent(this, ListOfShoppingListsActivity.class));%0A                return true;
 %0A%0A      

add launcher icon to actionbar