Android layout title bar is not visible

Makko

I have created xml layout file. And when I give it as content to my Activity the TITLE BAR IS NOT VISIBLE. How can I make it visible. I tried to use setTitle("Title");

protected void onCreate(Bundle savedInstanceState) { 
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN); 
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); 
super.onCreate(savedInstanceState); 
Bundle b = getIntent().getExtras(); 
int layoutId = b.getInt("layout");
Log.d("====>>>", " " + layoutId);
setContentView(layoutId); 
setTitle("Title"); 
}

function in onCreate() method. I is not work. This is my xml file.

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ScrollView01"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
    android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:paddingBottom="@dimen/activity_vertical_margin"
    tools:context="com.universityapp.enrollee.FacultyInformationActivity"
    android:scrollbars="vertical"
    >

     <TextView
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:text="@string/text_faculty_information_agro"
        android:textSize="15dp"
        android:textAlignment="center"
    />
</RelativeLayout>
</ScrollView>

I start activity via ListView:

 profListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {

            switch (position){
                case 0:
                    facultyInfoIntent = new Intent(getBaseContext(), FacultyInformationActivity.class);
                    Bundle b = new Bundle();
                    b.putInt("layout", facultyLayoutNames[position]);
                    facultyInfoIntent.putExtras(b);
                    startActivity(facultyInfoIntent);
            }

            Log.d("Selected faculty", facultiNames[position]);
        }
    });

This is my Manifest:

    <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.universityapp.universityapp" >

    <uses-permission android:name="android.permission.CALL_PHONE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.CALL_PHONE" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity android:name="com.universityapp.common.MainActivity" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.universityapp.common.MenuActivity"
            android:label="Главное меню" >
        </activity>
        <activity
            android:name="com.universityapp.enrollee.ContacsActivity"
            android:label="Наши контакты" >
        </activity>
        <activity
            android:name="com.universityapp.enrollee.Map"
            android:label="@string/title_activity_map" >
        </activity>

        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />
        <meta-data
            android:name="com.google.android.maps.v2.API_KEY"
            android:value="@string/google_maps_key" />

        <activity
            android:name="com.universityapp.enrollee.MapsActivity"
            android:label="@string/title_activity_maps" >
        </activity>
        <activity
            android:name="com.universityapp.bachelor.PlatonusActivity"
            android:label="@string/title_activity_platonus" >
        </activity>
        <activity
            android:name="com.universityapp.database.DatabaseActivity"
            android:label="@string/title_activity_database" >
        </activity>
        <activity
            android:name="com.universityapp.enrollee.EnrUniversityInfo"
            android:label="@string/title_activity_enr_university_info" >
        </activity>
        <activity
            android:name="com.universityapp.enrollee.ProfessionsActivity"
            android:label="@string/title_activity_professions" >
        </activity>
        <activity
            android:name="com.universityapp.enrollee.FacultyInformationActivity"
            android:label="@string/title_activity_faculty_information" >
        </activity>
    </application>

</manifest>
Makko

I found the answer! I have changed Activity to ActionBarActivity and it works!

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to remove title bar in android?

From Dev

Changing the window title bar on an Android Application

From Dev

Changing background android title bar

From Dev

Last cell is not visible in custom Android ListView layout

From Dev

Android - Capture ScreenShot Programmatically without title bar

From Dev

Android Get height of the visible layout programmatically

From Dev

Android 4.2 Title Bar over Action Bar

From Dev

android: using adjustPan and without scrolling the title bar

From Dev

Remove app title bar android

From Dev

Set OnClick Listener on Action Bar Title in Android

From Dev

how to rotate a title in android layout?

From Dev

How to set the title of action bar in center in Android

From Dev

How to hide the title bar for of android app?

From Dev

Set Title and SubTitle in CollapsingToolBar layout Android

From Dev

Android status bar scrolling up with coordinator layout, leaving status icons overlapping toolbar title

From Dev

Android DialogFragment No_Title feature affects layout

From Dev

Android: remove title bar error

From Dev

Status bar shows on android when keyboard is visible

From Dev

Invisible Layout not visible when make it visible in Android

From Dev

Changing background android title bar

From Dev

How to change layout of form title bar to RTL?

From Dev

Android shared title bar with functionality

From Dev

Working in cakephp trying to implement a login form in layout title bar

From Dev

How to add Tool bar title at the center of layout

From Dev

how to visible layout in android

From Dev

Tablayout title aren't visible in Android

From Dev

Android Linear Layout is not visible

From Dev

Layout not visible in Full Screen Activity in Xamarin Android

From Dev

JQuery dialog title bar and close button not visible

Related Related

  1. 1

    How to remove title bar in android?

  2. 2

    Changing the window title bar on an Android Application

  3. 3

    Changing background android title bar

  4. 4

    Last cell is not visible in custom Android ListView layout

  5. 5

    Android - Capture ScreenShot Programmatically without title bar

  6. 6

    Android Get height of the visible layout programmatically

  7. 7

    Android 4.2 Title Bar over Action Bar

  8. 8

    android: using adjustPan and without scrolling the title bar

  9. 9

    Remove app title bar android

  10. 10

    Set OnClick Listener on Action Bar Title in Android

  11. 11

    how to rotate a title in android layout?

  12. 12

    How to set the title of action bar in center in Android

  13. 13

    How to hide the title bar for of android app?

  14. 14

    Set Title and SubTitle in CollapsingToolBar layout Android

  15. 15

    Android status bar scrolling up with coordinator layout, leaving status icons overlapping toolbar title

  16. 16

    Android DialogFragment No_Title feature affects layout

  17. 17

    Android: remove title bar error

  18. 18

    Status bar shows on android when keyboard is visible

  19. 19

    Invisible Layout not visible when make it visible in Android

  20. 20

    Changing background android title bar

  21. 21

    How to change layout of form title bar to RTL?

  22. 22

    Android shared title bar with functionality

  23. 23

    Working in cakephp trying to implement a login form in layout title bar

  24. 24

    How to add Tool bar title at the center of layout

  25. 25

    how to visible layout in android

  26. 26

    Tablayout title aren't visible in Android

  27. 27

    Android Linear Layout is not visible

  28. 28

    Layout not visible in Full Screen Activity in Xamarin Android

  29. 29

    JQuery dialog title bar and close button not visible

HotTag

Archive