package com.andreamontanari.placeholder;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.MenuItem;
import android.view.View;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.andreamontanari.placeholder.utils.PlaceMisc;

/**
 * Created by andreamontanari on 07/07/16.
 */
public class PlacesActivity extends AppCompatActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_places);

        setToolBar();

        // Create a new Fragment to be placed in the activity layout
        PlacesOnListFragment firstFragment = new PlacesOnListFragment();

        // In case this activity was started with special instructions from an
        // Intent, pass the Intent's extras to the fragment as arguments
        firstFragment.setArguments(getIntent().getExtras());

        // Add the fragment to the 'fragment_container' FrameLayout
        getSupportFragmentManager().beginTransaction()
                .add(R.id.fragment_container, firstFragment).commit();

    }

    private void setToolBar() {
        Toolbar tb = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(tb);
        ActionBar ab = getSupportActionBar();
        ab.setDisplayHomeAsUpEnabled(true);
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem menuItem) {
        switch (menuItem.getItemId()) {
            case android.R.id.home:
                Intent homeIntent = new Intent(this, IntroActivity.class);
                homeIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                startActivity(homeIntent);
        }
        return (super.onOptionsItemSelected(menuItem));
    }

}

@@ -1594,24 +1594,25 @@
 %0A    %7D%0A%0A    
+ 
 @Override%0A  
@@ -1634,48 +1634,465 @@
 n on
+Create
 Options
-ItemSelected(MenuItem menuItem) %7B
+Menu(Menu menu) %7B%0A            MenuInflater inflater = getMenuInflater();%0A            inflater.inflate(R.menu.places_menu, menu);%0A            for (int i = 0; i %3C menu.size(); i++) %7B%0A                menu.getItem(i).setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);%0A            %7D%0A            return super.onCreateOptionsMenu(menu);%0A        %7D%0A%0A    @Override%0A    public boolean onOptionsItemSelected(MenuItem item) %7B%0A        // Handle item selection
 %0A   
@@ -2104,21 +2104,17 @@
 switch (
-menuI
+i
 tem.getI
@@ -2120,24 +2120,216 @@
 ItemId()) %7B%0A
+            case R.id.info_task:%0A                Intent intent = new Intent(IntroActivity.this, InformationActivity.class);%0A                startActivity(intent);%0A                return true;%0A
             
@@ -2547,26 +2547,44 @@
         
-%7D%0A
+    default:%0A       
         
 return (
@@ -2579,16 +2579,16 @@
     
+ 
 return 
-(
 supe
@@ -2615,19 +2615,24 @@
 ted(
-menuItem));
+item);%0A        %7D
 %0A   

Update PlacesActivity.java