// Show users similar plants
// @author: Christopher Besser and Antonio Muscarella
package com.scientists.happy.botanist.ui;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.ListAdapter;
import android.widget.ListView;

import com.scientists.happy.botanist.R;
import com.scientists.happy.botanist.data.DatabaseManager;

import java.util.ArrayList;

import za.co.riggaroo.materialhelptutorial.TutorialItem;
public class SimilarPlantsActivity extends AppCompatActivity {
    private DatabaseManager mDatabase;

    /**
     * The activity is launched
     * @param savedInstanceState - current app state
     */
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_similar_plants);
        mDatabase = DatabaseManager.getInstance();
        mDatabase.showTutorial(this, loadTutorialItems(), false);
        ListView list = (ListView) findViewById(R.id.similar_plants);
        list.setEmptyView(findViewById(R.id.empty_list_view));
        String group = (String) getIntent().getExtras().get("group");
        String species = (String) getIntent().getExtras().get("species");
        ListAdapter adapter = mDatabase.getSimilarPlants(this, group, species);
        list.setAdapter(adapter);
    }

    /**
     * User navigated up from the activity
     * @return returns true
     */
    @Override
    public boolean onSupportNavigateUp() {
        super.onBackPressed();
        return true;
    }

    /**
     * Handle options menu
     * @param menu - options menu
     * @return Returns success code
     */
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.menu_help, menu);
        return true;
    }

    /**
     * Handle selected option
     * @param item - selected option
     * @return Returns success code
     */
    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        if (item.getItemId() == R.id.action_help) {
            mDatabase.showTutorial(this, loadTutorialItems(), true);
        }
        return super.onOptionsItemSelected(item);
    }

    /**
     * Fetch assets for the tutorial
     * @return - Returns the list of tutorial items
     */
    private ArrayList<TutorialItem> loadTutorialItems() {
        TutorialItem tutorialItem1 = new TutorialItem(getString(R.string.tutorial_title_0), getString(R.string.tutorial_contents_0),
                R.color.colorPrimary, R.drawable.tutorial_0,  R.drawable.tutorial_0);
        TutorialItem tutorialItem2 = new TutorialItem(getString(R.string.tutorial_title_1), getString(R.string.tutorial_contents_1),
                R.color.colorPrimary, R.drawable.tutorial_1,  R.drawable.tutorial_1);
        TutorialItem tutorialItem3 = new TutorialItem(getString(R.string.tutorial_title_2), getString(R.string.tutorial_contents_2),
                R.color.colorPrimary, R.drawable.tutorial_2,  R.drawable.tutorial_2);
        ArrayList<TutorialItem> tutorialItems = new ArrayList<>();
        tutorialItems.add(tutorialItem1);
        tutorialItems.add(tutorialItem2);
        tutorialItems.add(tutorialItem3);
        return tutorialItems;
    }
}
@@ -197,64 +197,8 @@
 ty;%0A
-import android.view.Menu;%0Aimport android.view.MenuItem;%0A
 impo
@@ -228,16 +228,16 @@
 dapter;%0A
+
 import a
@@ -260,17 +260,16 @@
 stView;%0A
-%0A
 import c
@@ -362,95 +362,8 @@
 ger;
-%0A%0Aimport java.util.ArrayList;%0A%0Aimport za.co.riggaroo.materialhelptutorial.TutorialItem;
 %0Apub
@@ -461,17 +461,16 @@
 tabase;%0A
-%0A
     /**%0A
@@ -790,74 +790,8 @@
 ();%0A
-        mDatabase.showTutorial(this, loadTutorialItems(), false);%0A
     
@@ -1355,24 +1355,24 @@
 kPressed();%0A
+
         retu
@@ -1389,1701 +1389,6 @@
    %7D
-%0A%0A    /**%0A     * Handle options menu%0A     * @param menu - options menu%0A     * @return Returns success code%0A     */%0A    @Override%0A    public boolean onCreateOptionsMenu(Menu menu) %7B%0A        getMenuInflater().inflate(R.menu.menu_help, menu);%0A        return true;%0A    %7D%0A%0A    /**%0A     * Handle selected option%0A     * @param item - selected option%0A     * @return Returns success code%0A     */%0A    @Override%0A    public boolean onOptionsItemSelected(MenuItem item) %7B%0A        if (item.getItemId() == R.id.action_help) %7B%0A            mDatabase.showTutorial(this, loadTutorialItems(), true);%0A        %7D%0A        return super.onOptionsItemSelected(item);%0A    %7D%0A%0A    /**%0A     * Fetch assets for the tutorial%0A     * @return - Returns the list of tutorial items%0A     */%0A    private ArrayList%3CTutorialItem%3E loadTutorialItems() %7B%0A        TutorialItem tutorialItem1 = new TutorialItem(getString(R.string.tutorial_title_0), getString(R.string.tutorial_contents_0),%0A                R.color.colorPrimary, R.drawable.tutorial_0,  R.drawable.tutorial_0);%0A        TutorialItem tutorialItem2 = new TutorialItem(getString(R.string.tutorial_title_1), getString(R.string.tutorial_contents_1),%0A                R.color.colorPrimary, R.drawable.tutorial_1,  R.drawable.tutorial_1);%0A        TutorialItem tutorialItem3 = new TutorialItem(getString(R.string.tutorial_title_2), getString(R.string.tutorial_contents_2),%0A                R.color.colorPrimary, R.drawable.tutorial_2,  R.drawable.tutorial_2);%0A        ArrayList%3CTutorialItem%3E tutorialItems = new ArrayList%3C%3E();%0A        tutorialItems.add(tutorialItem1);%0A        tutorialItems.add(tutorialItem2);%0A        tutorialItems.add(tutorialItem3);%0A        return tutorialItems;%0A    %7D
 %0A%7D

Replace accidentally deleted onSupportNavigateUp from SimilarPlantsActivity