title: Android How to make back button without Actionbar and Toolbar?
body: <p>I made a theme like this in res/values/style.xml and applied to remove
  ActionBar.</p>
  
  <pre><code>&lt;style name="AppTheme.NoActionbar"&gt;
          &lt;item name="windowActionBar"&gt;false&lt;/item&gt;
          &lt;item name="windowNoTitle"&gt;false&lt;/item&gt;
      &lt;/style&gt;
  </code></pre>
  
  <p>And I made a LinerLayout looks like a ActionBar with title and a button(it will have back function). </p>
  
  <p>I'd like to upload the pictures, but I can't upload them yet.</p>
  
  <p>This is a part of the layout.xml</p>
  
  <pre><code>&lt;LinearLayout
          android:id="@+id/ActionBarProductInfo"
          android:layout_width="match_parent"
          android:layout_height="70dp"
          android:background="@color/colorPrimary"
          android:orientation="horizontal"&gt;
  
              &lt;ImageButton
                  android:id="@+id/backToMain"
                  android:layout_width="60dp"
                  android:layout_height="60dp"
                  android:layout_gravity="center"
                  android:layout_marginLeft="15dp"
                  android:layout_marginStart="15dp"
                  android:background="@drawable/image_back_34dp" /&gt;
  
              &lt;TextView
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_gravity="center"
                  android:layout_marginLeft="210dp"
                  android:layout_marginStart="210dp"
                  android:text="Input product information"
                  android:textColor="@android:color/white"
                  android:textSize="40sp"
                  android:textStyle="bold" /&gt;
  
      &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>How can I put a back function in the button(id:backToMain)?</p>