Action bar is not displayed

Asked 2 years ago, Updated 2 years ago, 42 views

I'm making a Twitter app on Android Studio, but when I run it on a real machine, I don't see the action bar where the title of the app should be displayed.
I don't think it's set to not display...
If you know how to solve this problem, please let me know.

The actual machine is Nexus 7.

AndroidManifest

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="17"/>

<uses-permission android:name="android.permission.INTERNET"/>


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

            <category android:name="android.intent.category.LAUNCHER"/>
        </intent-filter>
    </activity>

    <activity
        android:name = ".TweetActivity"
        android:windowSoftInputMode="adjustResize"/>
    <activity
        android:name = ".TwitterOAuthActivity"
        android: launchMode="singleTask">
    <intent-filter>
        <action android:name="android.intent.action.VIEW"/>

        <category android:name="android.intent.category.DEFAULT"/>
        <category android:name="android.intent.category.BROWSABLE"/>

        <data
            android: host="twitter"
            android: scheme="zzzakiii"/>
    </intent-filter>
</activity>
</application>

</manifest>

Layout xml

<FrameLayout 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=".MainActivity">

<TextView android:text="@string/hello_world" android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android: id="@+id/textView"/>

<TableRow
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_below="@+id/textView"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"
    android:layout_marginTop="179dp">/TableRow>

<LinearLayout
    android: orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_alignParentBottom="true"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true">
</LinearLayout>

</FrameLayout>

// styles.xml

<!--Base application theme.-->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <!--Customize your here.-->

</style>

android

2022-09-30 19:21

1 Answers

When I changed Android: Theme from App Theme to Widget.AppCompat.ActionBar, which is set to default, ActionBar was displayed.


2022-09-30 19:21

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.