@Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_customize);

    Bundle bundle = getIntent().getExtras();
    if (bundle != null) {
      type = bundle.getString("Type");
    }

    bundle = getIntent().getBundleExtra("user_details");

    if (bundle != null) {
      if (type.equals("Name")) {
        this.givenValue = bundle.getString("user_name");
      } else {
        this.givenValue = bundle.getString("user_phone");
        ((EditText) findViewById(R.id.customize_old)).setInputType(InputType.TYPE_CLASS_PHONE);
        ((EditText) findViewById(R.id.customize_new)).setInputType(InputType.TYPE_CLASS_PHONE);
      }
    }

    ((TextView) findViewById(R.id.customize_title))
        .setText(getString(R.string.customize_title) + " " + type);
    ((EditText) findViewById(R.id.customize_old))
        .setHint(getString(R.string.customize_old) + " " + type);
    ((EditText) findViewById(R.id.customize_new))
        .setHint(getString(R.string.customize_new) + " " + type);
    ((Button) findViewById(R.id.customize_btn))
        .setText(getString(R.string.customize_btn) + " " + type);

    ActionBar mainActionBar = getSupportActionBar();
    mainActionBar.setDisplayHomeAsUpEnabled(true);
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_view_note);
    Intent intent = getIntent();
    mNote = (Note) intent.getSerializableExtra("note");

    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    ActionBar supportActionBar = getSupportActionBar();
    if (supportActionBar != null) {
      supportActionBar.setHomeAsUpIndicator(R.drawable.ic_keyboard_backspace_black_24dp);
      supportActionBar.setDisplayHomeAsUpEnabled(true);
      supportActionBar.setTitle("");
    }

    FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
    fab.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View view) {
            Intent intent = new Intent(ViewNoteActivity.this, EditNoteActivity.class);
            intent.putExtra("note", mNote);
            startActivityForResult(intent, VIEW_REQUEST_CODE);
          }
        });

    initViews();
    initListeners();
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_pager);

    setSupportActionBar((android.support.v7.widget.Toolbar) findViewById(R.id.toolbar));

    pager = finder.find(R.id.vp_pages);

    repository = getIntent().getParcelableExtra(EXTRA_REPOSITORY);
    ids = getCharSequenceArrayExtra(EXTRA_BASES);
    initialPosition = getIntExtra(EXTRA_POSITION);

    adapter = new CommitPagerAdapter(this, repository, ids);
    pager.setAdapter(adapter);
    pager.setOnPageChangeListener(this);
    pager.scheduleSetItem(initialPosition, this);
    onPageSelected(initialPosition);

    ActionBar actionBar = getSupportActionBar();
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setSubtitle(InfoUtils.createRepoId(repository));
    avatars.bind(actionBar, repository.owner);
  }
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_tarot_feedback);

    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);

    final ActionBar ab = getSupportActionBar();
    ab.setDisplayHomeAsUpEnabled(false);

    FloatingActionButton fablogin = (FloatingActionButton) findViewById(R.id.fab_login);
    fablogin.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View view) {
            if (TextUtils.isEmpty(getUsername())) {
              facebookLogin();
            } else {
              addFeedback(getUsername());
            }
          }
        });
    RecyclerView rv = (RecyclerView) findViewById(R.id.recyclerview);
    rv.setHasFixedSize(true);
    LinearLayoutManager llm = new LinearLayoutManager(this);
    llm.setOrientation(LinearLayoutManager.VERTICAL);
    rv.setLayoutManager(llm);
    updateList();
  }
 @Override
 public boolean onCreateOptionsMenu(Menu menu) {
   ActionBar actionBar = getSupportActionBar();
   actionBar.setHomeAsUpIndicator(R.drawable.back);
   actionBar.setDisplayHomeAsUpEnabled(true);
   return true;
 }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    savedInstanceState = getIntent().getExtras().getBundle("bundle");
    this.tab = savedInstanceState.getStringArrayList("list");
    this.pos = savedInstanceState.getInt("position");
    setContentView(R.layout.activity_town_details);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar2);
    setSupportActionBar(toolbar);

    ActionBar ab = getSupportActionBar();
    ab.setDisplayHomeAsUpEnabled(true);

    refresh();
    List<TownDetailsFragment> list = new ArrayList<TownDetailsFragment>();
    for (int i = 0; i < this.tab.size(); i++) {
      list.add(TownDetailsFragment.newInstance(this.tab.get(i)));
    }

    MyPagerAdapter pagerAdapter = new MyPagerAdapter(getSupportFragmentManager(), list);
    this.receiverData = new RefreshAllReceiver(pagerAdapter, this.tab);
    this.receiverIcon = new RefreshIconReceiver(pagerAdapter);
    this.filtreData = new IntentFilter("com.intent.action.ALLRECEIVE");
    this.filtreIcon = new IntentFilter("com.intent.action.ICON_UPDATE");

    this.registerReceiver(receiverData, filtreData);
    this.registerReceiver(receiverIcon, filtreIcon);

    refresh();
    ViewPager view = (ViewPager) findViewById(R.id.viewpager);
    view.setAdapter(pagerAdapter);
    view.setCurrentItem(pos);
  }
  protected void setupToolbar() {
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    ActionBar ab = getSupportActionBar();
    if (ab != null) {
      ab.setDisplayHomeAsUpEnabled(true);
    }

    // Status bar
    if (Build.VERSION.SDK_INT >= 21) {
      getWindow().setStatusBarColor(Color.parseColor(mColors[GridActivity.DARK_PRIMARY]));
    }

    // Entire bar layout
    int barColor = Color.parseColor(mColors[GridActivity.PRIMARY]);
    AppBarLayout barLayout = (AppBarLayout) this.findViewById(R.id.app_bar);
    if (barLayout != null) {
      barLayout.setBackgroundColor(barColor);
    }
    toolbar.setBackgroundColor(barColor);

    CollapsingToolbarLayout collapsingToolbarLayout =
        (CollapsingToolbarLayout) this.findViewById(R.id.toolbar_layout);
    if (collapsingToolbarLayout != null) {
      collapsingToolbarLayout.setBackgroundColor(barColor);
      collapsingToolbarLayout.setContentScrimColor(barColor);
    }
  }
  private void configureToolBar() {
    this.getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    this.getSupportActionBar().setDisplayShowHomeEnabled(true);

    ActionBar mActionBar = getSupportActionBar();
    mActionBar.setDisplayHomeAsUpEnabled(true);
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_search_friends);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);

    ActionBar ab = getSupportActionBar();
    ab.setDisplayHomeAsUpEnabled(true);

    queue = Single.getInstance().getRequestQueue();
    pref = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
    token = pref.getString("token", "none");

    tvq = (TextView) findViewById(R.id.tvq);
    btnSearch = (Button) findViewById(R.id.btnSearch);

    btnSearch.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            if (tvq.getText().toString().trim().equals("")) {
              Toast.makeText(SearchFriendsActivity.this, "Please enter a query", Toast.LENGTH_SHORT)
                  .show();
            } else {
              Intent i;
              i = new Intent(getApplicationContext(), AddFriendsActivity.class);
              // -1 specifies add more friends
              i.putExtra("group_id", -1L);
              i.putExtra("q", tvq.getText().toString().trim());
              startActivity(i);
            }
          }
        });
  }
Beispiel #10
0
 private void setupToolbar() {
   toolbar = (Toolbar) findViewById(R.id.toolbar);
   setSupportActionBar(toolbar);
   // Show menu icon
   final ActionBar ab = getSupportActionBar();
   ab.setDisplayHomeAsUpEnabled(true);
 }
 /**
  * Per the navigation drawer design guidelines, updates the action bar to show the global app
  * 'context', rather than just what's in the current screen.
  */
 private void showGlobalContextActionBar() {
   ActionBar actionBar = getActionBar();
   //        actionBar.setDisplayHomeAsUpEnabled(false);
   //        actionBar.setDisplayShowTitleEnabled(true);
   //        actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
   actionBar.setTitle(R.string.app_name);
 }
Beispiel #12
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    UmengUpdateAgent.setDefault();
    UmengUpdateAgent.update(this);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);

    mDrawerLayout = (ViewGroup) findViewById(R.id.drawer_layout);
    mNavigationDrawerFragment =
        (NavigationDrawerFragment) getFragmentManager().findFragmentById(R.id.left_drawer);
    mTitle = getTitle();

    mFavoriteTabTitles = getResources().getStringArray(R.array.v2ex_favorite_tab_titles);
    mFavoriteTabPaths = getResources().getStringArray(R.array.v2ex_favorite_tab_paths);
    mMainTitles = getResources().getStringArray(R.array.v2ex_nav_main_titles);

    mSpinnerAdapter = new SpinnerAdapter(this, mFavoriteTabTitles);

    ActionBar supportActionBar = getSupportActionBar();
    supportActionBar.setCustomView(R.layout.actionbar_custom_spinner);
    mActionbarCustom = supportActionBar.getCustomView();
    Spinner spinner = (Spinner) supportActionBar.getCustomView().findViewById(R.id.spinner);
    spinner.setAdapter(mSpinnerAdapter);
    //        spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
    //            @Override
    //            public void onItemSelected(AdapterView<?> parent, View view, int position, long
    // id) {
    //                TopicsFragment fragment = new TopicsFragment();
    //                Bundle bundle = new Bundle();
    //                mSpinnerAdapter.setCheckPos(position);
    //                bundle.putString("tab", mFavoriteTabPaths[position]);
    //                bundle.putBoolean("attach_main", true);
    //                bundle.putBoolean("show_menu", false);
    //                fragment.setArguments(bundle);
    //
    //                FragmentTransaction fragmentTransaction =
    // getFragmentManager().beginTransaction();
    //                fragmentTransaction.replace(R.id.container, fragment,
    // mFavoriteTabTitles[position]).commit();
    //            }
    //
    //            @Override
    //            public void onNothingSelected(AdapterView<?> parent) {
    //
    //            }
    //        });

    // Set up the drawer.
    mNavigationDrawerFragment.setUp(
        R.id.left_drawer, (DrawerLayout) findViewById(R.id.drawer_layout));

    // ActionBar actionBar = getSupportActionBar();
    // actionBar.setDisplayHomeAsUpEnabled(true);
    // actionBar.setHomeButtonEnabled(true);
    // actionBar.setDisplayShowTitleEnabled(true);

    if (mIsLogin) initAccount();
  }
Beispiel #13
0
 @Override
 protected void onInitActionBar() {
   // TODO Auto-generated method stub
   super.onInitActionBar();
   ActionBar actionBar = getSupportActionBar();
   actionBar.setTitle(R.string.saoyy);
 }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_commit_file_view);

    setSupportActionBar((android.support.v7.widget.Toolbar) findViewById(R.id.toolbar));

    repo = getIntent().getParcelableExtra(EXTRA_REPOSITORY);
    commit = getStringExtra(EXTRA_HEAD);
    sha = getStringExtra(EXTRA_BASE);
    path = getStringExtra(EXTRA_PATH);

    loadingBar = finder.find(R.id.pb_loading);
    codeView = finder.find(R.id.wv_code);

    file = CommitUtils.getName(path);
    isMarkdownFile = MarkdownUtils.isMarkdown(file);

    editor = new SourceEditor(codeView);
    editor.setWrap(PreferenceUtils.getCodePreferences(this).getBoolean(WRAP, false));

    ActionBar actionBar = getSupportActionBar();
    int lastSlash = path.lastIndexOf('/');
    if (lastSlash != -1) actionBar.setTitle(path.substring(lastSlash + 1));
    else actionBar.setTitle(path);
    actionBar.setSubtitle(getString(R.string.commit_prefix) + CommitUtils.abbreviate(commit));
    avatars.bind(actionBar, repo.owner);

    loadContent();
  }
Beispiel #15
0
 private void navigate(int menuItem) {
   ActionBar actionBar = getSupportActionBar();
   if (actionBar != null) {
     int titleRes = 0;
     switch (menuItem) {
       case R.id.nav_item_favorites:
         titleRes = R.string.favorites;
         getSupportFragmentManager()
             .beginTransaction()
             .replace(R.id.content_fragment_container, FavoritesFragment.newInstance())
             .commit();
         break;
       case R.id.nav_item_departures:
         titleRes = R.string.real_time_departures;
         getSupportFragmentManager()
             .beginTransaction()
             .replace(R.id.content_fragment_container, DeparturesFragment.newInstance())
             .commit();
         break;
       case R.id.nav_item_debug:
         titleRes = R.string.debug;
         getSupportFragmentManager()
             .beginTransaction()
             .replace(R.id.content_fragment_container, ManualRequestFragment.newInstance())
             .addToBackStack(null)
             .commit();
         break;
     }
     actionBar.setTitle(getResources().getString(titleRes));
   }
 }
Beispiel #16
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    doBindService();

    final ActionBar actionBar = getSupportActionBar();
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);

    mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());

    mViewPager = (ViewPager) findViewById(R.id.pager);
    mViewPager.setAdapter(mSectionsPagerAdapter);

    mViewPager.setOnPageChangeListener(
        new ViewPager.SimpleOnPageChangeListener() {
          @Override
          public void onPageSelected(int position) {
            actionBar.setSelectedNavigationItem(position);
          }
        });

    // For each of the sections in the app, add a tab to the action bar.
    for (int i = 0; i < mSectionsPagerAdapter.getCount(); i++) {

      actionBar.addTab(
          actionBar.newTab().setText(mSectionsPagerAdapter.getPageTitle(i)).setTabListener(this));
    }
  }
  private void customActionBar() {

    actionBar = ((LandingActivity) getActivity()).getSupportActionBar();
    actionBar.removeAllTabs();
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
    actionBar.setTitle("Select Address");
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    ActionBar actionBar = getSupportActionBar();
    actionBar.setDisplayHomeAsUpEnabled(true);

    setContentView(R.layout.view_cert_activity);

    mSigneeKey = (TextView) findViewById(R.id.signee_key);
    mSigneeUid = (TextView) findViewById(R.id.signee_uid);
    mAlgorithm = (TextView) findViewById(R.id.algorithm);
    mType = (TextView) findViewById(R.id.signature_type);
    mReason = (TextView) findViewById(R.id.reason);
    mCreation = (TextView) findViewById(R.id.creation);

    mCertifierKey = (TextView) findViewById(R.id.signer_key_id);
    mCertifierUid = (TextView) findViewById(R.id.signer_uid);

    mRowReason = findViewById(R.id.row_reason);

    mViewCertifierButton = findViewById(R.id.view_cert_view_cert_key);

    mDataUri = getIntent().getData();
    if (mDataUri == null) {
      Log.e(Constants.TAG, "Intent data missing. Should be Uri of key!");
      finish();
      return;
    }

    getSupportLoaderManager().initLoader(0, null, this);
  }
  @Override
  public View onCreateView(
      LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    rootView = inflater.inflate(R.layout.proanswerwrite, container, false);
    dbVersion = ((MainActivity) getActivity()).getDBVersion();
    mTwoPane = ((MainActivity) getActivity()).getTwoPane();
    num = getArguments().getString("num");
    ansCount = getArguments().getString("ansCount");

    dbHelper = new DBHelper(getActivity(), dbName, null, dbVersion);
    db = dbHelper.getWritableDatabase();
    sql = "SELECT * FROM inner_db;";
    Cursor cursor = db.rawQuery(sql, null);
    cursor.moveToFirst();
    tempnick = cursor.getString(3);

    abar = ((MainActivity) getActivity()).getSupportActionBar();
    abar.setTitle(tempnick + "님에게 답변중");
    abar.setDisplayOptions(ActionBar.DISPLAY_SHOW_TITLE);
    abar.setDisplayHomeAsUpEnabled(true);

    ldialog = new LoadingDialog(this.getActivity()); // 변경
    ldialog
        .getWindow()
        .setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
    ldialog.show();
    answerViewThread = (AnswerViewThread) new AnswerViewThread();
    answerViewThread.execute();

    conet = (EditText) rootView.findViewById(R.id.replycon);
    conet.setPadding(20, 20, 20, 20);

    return rootView;
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_launch);
    mAContext = this;
    mContentView = findViewById(R.id.fullscreen_content);

    // Hide UI first
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
      actionBar.hide();
    }
    // Remove the status and navigation bar
    if (Build.VERSION.SDK_INT < 14) return;
    mContentView.setSystemUiVisibility(
        View.SYSTEM_UI_FLAG_LOW_PROFILE
            | View.SYSTEM_UI_FLAG_FULLSCREEN
            | View.SYSTEM_UI_FLAG_LAYOUT_STABLE
            | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
            | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
            | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);

    if (Small.getIsNewHostApp()) {
      TextView tvPrepare = (TextView) findViewById(R.id.prepare_text);
      tvPrepare.setVisibility(View.VISIBLE);
    }
  }
 /** Set up the {@link android.app.ActionBar}, if the API is available. */
 private void setupActionBar() {
   ActionBar actionBar = getSupportActionBar();
   if (actionBar != null) {
     // Show the Up button in the action bar.
     actionBar.setDisplayHomeAsUpEnabled(true);
   }
 }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    // establish a connection to the database
    dbConn = new DatabaseConnection(this);

    // set up Toolbar
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    ActionBar supportActionBar = getSupportActionBar();
    if (supportActionBar != null) supportActionBar.setDisplayShowTitleEnabled(false);

    // set up ViewPager for the days
    calendar = new Calendar(this, (ViewPager) findViewById(R.id.dayPager), FoodDayFragment.class);
    TextView changeDateButton = (TextView) findViewById(R.id.changeDate);
    calendar.setChangeDateButton(
        changeDateButton, 0xFFFFFFFF, ContextCompat.getColor(this, R.color.colorAccent));

    // set up FAB
    FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
    fab.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            long dateLong = calendar.getDate().getTime();
            Intent intent = new Intent(MainActivity.this, SelectionActivity.class);
            intent.putExtra(SelectionActivity.DISPLAY_DATE, dateLong);
            startActivity(intent);
          }
        });
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    // Set up the toolbar.
    toolbar = (Toolbar) findViewById(R.id.toolbar);
    toolbar.setTitle("Welcome");
    setSupportActionBar(toolbar);
    toolbar.setOnMenuItemClickListener(onToolbarMenuItemClickListener);
    ActionBar ab = getSupportActionBar();
    ab.setHomeAsUpIndicator(R.drawable.ic_menu);
    ab.setDisplayHomeAsUpEnabled(true);

    // Set up the navigation drawer.
    mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
    mDrawerLayout.setStatusBarBackground(R.color.colorPrimaryDark);
    NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
    if (navigationView != null) {
      setupDrawerContent(navigationView);
    }

    fragContainerId = R.id.main_content;

    if (savedInstanceState == null) {
      transitionTo(DemoHomePageFragment.newInstance());
    }

    // Uncomment me for iovation suppoort
    // start(getApplicationContext());
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_settle_info);

    ActionBar mActionBar = getSupportActionBar();
    mActionBar.setHomeButtonEnabled(true);
    mActionBar.setDisplayHomeAsUpEnabled(true);
    mActionBar.setTitle("提现明细");

    mListView = (AutoRefreshListView) findViewById(R.id.settle_listview);
    mListView.setOnGetToButtomListener(
        new AutoRefreshListView.OnGetToButtomListener() {
          @Override
          public void onButtomAndNetOk() {
            fetchData();
          }
        });

    mListView.setIfAutoScroll(false);

    adapter = new MAdapter();
    mListView.setAdapter(adapter);

    if (CodeUtil.checkNetState(this)) {
      loadDate = DateUtil.getNowDate();
      fetchData();
    } else {
      mListView.setStateNoMoreData();
    }
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    actionBar = getSupportActionBar();
    actionBar.setDefaultDisplayHomeAsUpEnabled(true);
    actionBar.setLogo(R.drawable.minion);
    setContentView(R.layout.activity_test);
    itemList = getResources().getStringArray(R.array.itemList);
    drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
    drawerList = (ListView) findViewById(R.id.left_drawer);
    drawerList.setAdapter(new ArrayAdapter<String>(this, R.layout.drawer_list_item, itemList));
    drawerList.setOnItemClickListener(new SlideMenuClickListener());
    //   actionBar=getSupportActionBar();
    // actionBar.show();
    // actionBar.setLogo(R.drawable.ic_drawer);
    // getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    // getSupportActionBar().setHomeButtonEnabled(true);

    /* drawerToggle = new ActionBarDrawerToggle(this, drawerLayout,R.drawable.ic_drawer,R.string.drawer_open, R.string.drawer_close ){
        @Override
        public void onDrawerClosed(View drawerView) {
            invalidateOptionsMenu(); // calls onPrepareOptionsMenu()
        }

        @Override
        public void onDrawerOpened(View drawerView) {
            invalidateOptionsMenu(); // calls onPrepareOptionsMenu()
        }
    };*/
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_splash);

    actionBar = getSupportActionBar();
    actionBar.setIcon(R.mipmap.ic_satelite);
    actionBar.setDisplayShowHomeEnabled(true);
    actionBar.setBackgroundDrawable(
        new ColorDrawable(Color.parseColor(Utility.ACTIONBAR_BACKGROUND)));

    seconds = Utility.isSplashShow(this) ? THREE_SECONDS : ZERO_SECONDS;

    Thread splash =
        new Thread() {
          public void run() {
            try {
              sleep(seconds * MILI_SECONDS);
              Intent intent = new Intent(getBaseContext(), HomeActivity.class);
              startActivity(intent);
              Utility.stopSplashShow(getBaseContext());
              finish();
            } catch (InterruptedException e) {
              e.printStackTrace();
            }
          }
        };

    splash.start();
  }
  /** Called when the activity is first created. */
  @Override
  public void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    final ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
      actionBar.setDisplayHomeAsUpEnabled(true);
    }

    // set language
    MainActivity.setLocale(this);
    setContentView(R.layout.speech);
    speechActivity = this;

    // force media volume controls
    this.setVolumeControlStream(AudioManager.STREAM_MUSIC);

    final SharedPreferences prefs = this.getSharedPreferences(ListFragment.SHARED_PREFS, 0);
    doCheckbox(prefs, R.id.speech_gps, ListFragment.PREF_SPEECH_GPS);
    doCheckbox(prefs, R.id.speech_run, ListFragment.PREF_SPEAK_RUN);
    doCheckbox(prefs, R.id.speech_new_wifi, ListFragment.PREF_SPEAK_NEW_WIFI);
    doCheckbox(prefs, R.id.speech_new_cell, ListFragment.PREF_SPEAK_NEW_CELL);
    doCheckbox(prefs, R.id.speech_queue, ListFragment.PREF_SPEAK_QUEUE);
    doCheckbox(prefs, R.id.speech_miles, ListFragment.PREF_SPEAK_MILES);
    doCheckbox(prefs, R.id.speech_time, ListFragment.PREF_SPEAK_TIME);
    doCheckbox(prefs, R.id.speech_battery, ListFragment.PREF_SPEAK_BATTERY);
    doCheckbox(prefs, R.id.speech_ssid, ListFragment.PREF_SPEAK_SSID, false);
    doCheckbox(prefs, R.id.speech_wifi_restart, ListFragment.PREF_SPEAK_WIFI_RESTART);
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_manual_zoom);

    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);

    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
      actionBar.setDisplayHomeAsUpEnabled(true);
      actionBar.setDisplayShowHomeEnabled(true);
    }

    mapView = (MapView) findViewById(R.id.mapView);
    mapView.setStyleUrl(Style.SATELLITE);
    mapView.onCreate(savedInstanceState);
    mapView.getMapAsync(
        new OnMapReadyCallback() {
          @Override
          public void onMapReady(@NonNull final MapboxMap mapboxMap) {
            ManualZoomActivity.this.mapboxMap = mapboxMap;

            UiSettings uiSettings = ManualZoomActivity.this.mapboxMap.getUiSettings();
            uiSettings.setAllGesturesEnabled(false);
          }
        });
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_info);

    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);

    // Back button
    setSupportActionBar(toolbar);
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
      actionBar.setDisplayHomeAsUpEnabled(true);
    }

    mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());

    mViewPager = (ViewPager) findViewById(R.id.container);
    mViewPager.setAdapter(mSectionsPagerAdapter);

    TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs);
    tabLayout.setupWithViewPager(mViewPager);

    // Set title if object exists.
    MalwareObject malwareObject = getIntent().getExtras().getParcelable("malware");
    if (malwareObject != null) {
      getSupportActionBar().setTitle(malwareObject.getName());
    }
  }
 private void setupToolbar() {
   Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
   setSupportActionBar(toolbar);
   ActionBar actionBar = getSupportActionBar();
   assert actionBar != null;
   actionBar.setDisplayHomeAsUpEnabled(true);
 }