Set a title in Toolbar from fragment in Android

I do this like this: from the fragment call getActivity().setTitle(“your title”); But where you call it is important, because if each Fragment has it’s own title, then one may override the other accidentally, which may be prevented like: @Override public void onResume() { super.onResume(); Activity activity = getActivity(); if (activity != null) { activity.setTitle(getString(R.string.my_title)); } … Read more

Video player lights out mode in Android using appcompat-v7

I’ve found fitssystemwindows pretty unreliable as well when you want some elements of the view hierarchy to be fullscreen and some elements to be below the status bar or action bar. But I’ve never seen the action bar behind the status bar. Is the Toolbar set as the activity actionbar? Are you using Window.FEATURE_ACTION_BAR_OVERLAY? Anyway, … Read more

Fragment overlaps the AppCompat toolbar

The reason is because you place it in a frame layout and then you add the fragment ontop of the toolbar. you need to do something like this <android.support.v4.widget.DrawerLayout android:id=”@+id/drawer_layout” android:layout_width=”match_parent” android:layout_height=”match_parent” > <LinearLayout android:layout_width=”match_parent” android:layout_height=”match_parent” android:orientation=”vertical”> <android.support.v7.widget.Toolbar android:id=”@+id/toolbar” android:layout_width=”match_parent” android:layout_height=”wrap_content” android:minHeight=”?attr/actionBarSize” android:background=”?attr/colorPrimary” app:theme=”@style/ThemeOverlay.AppCompat.Dark.ActionBar” app:popupTheme=”@style/ThemeOverlay.AppCompat.Light”/> <FrameLayout android:id=”@+id/content_frame” android:layout_width=”match_parent” android:layout_height=”match_parent” /> </LinearLayout> <FrameLayout android:id=”@+id/left_drawer” android:layout_width=”325dp” android:layout_height=”match_parent” … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)