Skip to content

Instantly share code, notes, and snippets.

@Krishan14sharma
Created December 17, 2014 07:27
Show Gist options
  • Save Krishan14sharma/2eab19967409fc5fdb20 to your computer and use it in GitHub Desktop.
Save Krishan14sharma/2eab19967409fc5fdb20 to your computer and use it in GitHub Desktop.
Contains optional Toolbar
package com.dnn.zapbuild.sports.controller.activity;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.widget.Toolbar;
import com.dnn.zapbuild.sports.R;
import butterknife.ButterKnife;
import butterknife.InjectView;
import butterknife.Optional;
import timber.log.Timber;
/**
* Created by zapbuild on 17/12/14.
*/
public class BaseToolBarActivity extends ActionBarActivity {
@Optional
@InjectView(R.id.toolbar)
protected Toolbar mToolbar;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
protected void onStart() {
super.onStart();
}
@Override
protected void onResume() {
super.onResume();
}
@Override
protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
ButterKnife.inject(this);
if (mToolbar != null) {
setSupportActionBar(mToolbar);
mToolbar.setNavigationIcon(R.drawable.ic_ab_drawer);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment