title: How to display Toolbar in my Application?
body: <p>I'm building an app with Android Studio, but I can't to display ToolBar.
  This is my AndroidManifest.xml</p>
  
  <pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.mcsolution.easymanagementandroid"&gt;
  
      &lt;uses-permission android:name="android.permission.INTERNET"/&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /&gt;
      &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/&gt;
      &lt;application
          android:allowBackup="true"
          android:icon="@mipmap/ic_launcher"
          android:label="@string/app_name"
          android:supportsRtl="true"
          android:theme="@style/AppTheme" &gt;
      &lt;activity
              android:name="com.mcsolution.easymanagementandroid.main.MainActivity"
              android:label="@string/app_name"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
  
          &lt;activity android:name="com.mcsolution.easymanagementandroid.main.nuovoOrdine"&gt;&lt;/activity&gt;
          &lt;activity android:name="com.mcsolution.easymanagementandroid.ordine.creaOrdine"&gt;&lt;/activity&gt;
          &lt;activity android:name="com.mcsolution.easymanagementandroid.ordine.mainOrdine"&gt;&lt;/activity&gt;
          &lt;activity android:name="com.mcsolution.easymanagementandroid.ordine.viewOrdine"&gt;&lt;/activity&gt;
          &lt;activity
              android:name="com.mcsolution.easymanagementandroid.setting.setting"
              android:label="@string/app_name"
              android:windowSoftInputMode="stateVisible|adjustResize"
              android:configChanges="orientation|screenSize"/&gt;
          &lt;activity android:name="com.mcsolution.easymanagementandroid.articoli.viewArticoli"
              android:windowSoftInputMode="stateVisible|adjustResize"
              android:configChanges="orientation|screenSize"/&gt;
          &lt;activity android:name="com.mcsolution.easymanagementandroid.clienti.mainClienti"
              android:windowSoftInputMode="stateVisible|adjustResize"
              android:configChanges="orientation|screenSize"/&gt;
          &lt;activity android:name="com.mcsolution.easymanagementandroid.clienti.viewClienti"
              android:windowSoftInputMode="stateVisible|adjustResize"
              android:configChanges="orientation|screenSize"/&gt;
          &lt;activity android:name="com.mcsolution.easymanagementandroid.clienti.infoCliente"
              android:windowSoftInputMode="stateHidden|adjustResize"
              android:configChanges="orientation|screenSize"/&gt;
          &lt;activity android:name="com.mcsolution.easymanagementandroid.clienti.operazioniCliente"
              android:windowSoftInputMode="stateHidden|adjustResize"
              android:configChanges="orientation|screenSize"/&gt;
          &lt;activity android:name="com.mcsolution.easymanagementandroid.clienti.operazioniClienteDettaglio"
              android:windowSoftInputMode="stateHidden|adjustResize"
              android:configChanges="orientation|screenSize"/&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>How can I display ToolBar ?</p>
  
  <blockquote>
    <p>EDIT
    This is the activity main</p>
  </blockquote>
  
  <pre><code>&lt;LinearLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      xmlns:card_view="http://schemas.android.com/apk/res-auto"
      android:orientation="vertical"
      android:background="@color/cardview_dark_background"&gt;
  
  
      &lt;android.support.v7.widget.CardView
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_margin="5dp"
          card_view:cardBackgroundColor="@color/cardview_light_background"&gt;
  
          &lt;LinearLayout
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"&gt;
              &lt;ImageButton
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:src="@drawable/articoli"
                  android:onClick="visualizzaArticoli"
                  android:background="@null"/&gt;
  
              &lt;TextView
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="Articoli"
                  android:layout_gravity="center_vertical"
                  android:layout_marginLeft="50dp"/&gt;
          &lt;/LinearLayout&gt;
      &lt;/android.support.v7.widget.CardView&gt;
  
      &lt;android.support.v7.widget.CardView
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_margin="5dp"
          card_view:cardBackgroundColor="@color/cardview_light_background"&gt;
  
          &lt;LinearLayout
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"&gt;
              &lt;ImageButton
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:src="@drawable/order"
                  android:onClick="creaOrdine"
                  android:background="@null"/&gt;
  
              &lt;TextView
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="@string/ordini"
                  android:layout_gravity="center_vertical"
                  android:layout_marginLeft="50dp"/&gt;
          &lt;/LinearLayout&gt;
      &lt;/android.support.v7.widget.CardView&gt;
  
      &lt;android.support.v7.widget.CardView
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_margin="5dp"
          card_view:cardBackgroundColor="@color/cardview_light_background"&gt;
  
          &lt;LinearLayout
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"&gt;
              &lt;ImageButton
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:src="@drawable/customer"
                  android:onClick="viewClienti"
                  android:background="@null"/&gt;
  
              &lt;TextView
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="@string/cliente"
                  android:layout_gravity="center_vertical"
                  android:layout_marginLeft="50dp"/&gt;
          &lt;/LinearLayout&gt;
      &lt;/android.support.v7.widget.CardView&gt;
  
      &lt;android.support.v7.widget.CardView
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_margin="5dp"
          card_view:cardBackgroundColor="@color/cardview_light_background"&gt;
  
          &lt;LinearLayout
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"&gt;
              &lt;ImageButton
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:src="@drawable/sincronizza"
                  android:onClick="allineaDatase"
                  android:background="@null"/&gt;
  
              &lt;TextView
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="@string/allinea_database"
                  android:layout_gravity="center_vertical"
                  android:layout_marginLeft="50dp"/&gt;
          &lt;/LinearLayout&gt;
      &lt;/android.support.v7.widget.CardView&gt;
  
      &lt;android.support.v7.widget.CardView
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_margin="5dp"
          card_view:cardBackgroundColor="@color/cardview_light_background"&gt;
  
          &lt;LinearLayout
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"&gt;
              &lt;ImageButton
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:src="@drawable/setting"
                  android:onClick="setting"
                  android:background="@null"/&gt;
  
              &lt;TextView
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="@string/impostazioni"
                  android:layout_gravity="center_vertical"
                  android:layout_marginLeft="50dp"/&gt;
          &lt;/LinearLayout&gt;
      &lt;/android.support.v7.widget.CardView&gt;
  
  
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>package com.mcsolution.easymanagementandroid.main;</p>
  
  <pre><code>import android.app.Activity;
  import android.app.ProgressDialog;
  import android.content.Intent;
  import android.content.pm.PackageManager;
  import android.content.pm.ResolveInfo;
  import android.os.Bundle;
  import android.util.Log;
  import android.view.Menu;
  import android.view.View;
  import android.widget.Toast;
  
  import com.mcsolution.easymanagementandroid.R;
  import com.mcsolution.easymanagementandroid.beans.Program;
  import com.mcsolution.easymanagementandroid.connection.MyDatabase;
  import com.mcsolution.easymanagementandroid.utility.SyncDati;
  
  public class MainActivity extends Activity {
      public MyDatabase db;
      public ProgressDialog dialog;
      public String url="";
      private static final Intent SCAN_INTENT = new Intent("com.google.zxing.client.android.SCAN");
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          //RelativeLayout layout = (RelativeLayout)findViewById(R.id.root);
          //  layout.setBackgroundColor(getResources().getColor(Color.BLUE));
  
          PackageManager packageManager = this.getPackageManager();
          @SuppressWarnings("unused")
          ResolveInfo resolveInfo = packageManager.resolveActivity(SCAN_INTENT, PackageManager.GET_RESOLVED_FILTER);
          //      if(resolveInfo==null) {
          //          ((Button)this.findViewById(R.id.scanButton)).setEnabled(false);
          //          ((TextView)this.findViewById(R.id.scanResult)).setText("Non hai installato nessuna applicazione per effettuare lo scan!!!\nScaricala qui: http://www.appbrain.com/app/com.google.zxing.client.android");
          //      }
  
      }
  
      public void onScan(View view) {
          startActivityForResult(SCAN_INTENT, 0);
      }
  
      private void apriConnessioneDB(){
          db=new MyDatabase(getApplicationContext());
          db.open();  //apriamo il db
      }
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.main, menu);
          return true;
      }
  
  
      public void visualizzaArticoli(View view){
          Intent intent = new Intent(this, com.mcsolution.easymanagementandroid.articoli.viewArticoli.class);
          startActivity(intent);
      }
      public void viewClienti(View view){
          Intent intent = new Intent(this, com.mcsolution.easymanagementandroid.clienti.mainClienti.class);
          startActivity(intent);
      }
  
      public void creaOrdine(View view){
          Intent intent = new Intent(this, com.mcsolution.easymanagementandroid.ordine.mainOrdine.class);
          startActivity(intent);
      }
      public void setting(View view){
          Intent intent = new Intent(this, com.mcsolution.easymanagementandroid.setting.setting.class);
          startActivity(intent);
      }
      public void allineaDatase(View view){
          try{
  
          }catch(Exception e){
              e.printStackTrace();
              Toast.makeText(this, e.getMessage(),
                      Toast.LENGTH_LONG).show();
          }
  
      }
  
  
  }
  </code></pre>