Skip to content Skip to sidebar Skip to footer

Action Bar Shown In Display Of Android Studio But Not In My Actual App

Hey guys i have an app with two activities, in the second activity i have an action bar with the title of my app displayed without problem. However in my launcher activity the bar

Solution 1:

Possibility 1: If your app extends Activity change it to AppCompatActivity.

Possibility 2: Are you sure you don't have different files of different versions named "styles.xml"? Make sure that none of the them have a theme named AppTheme.NoActionBar.

The device you are running the app will fetch the more adequate theme for its version. If you have a file named styles.xml(v21) for example, devices with Lollipop or above will use it.


Solution 2:

I am thinking that you somehow want to display a listView with content in your activity that has fails to display the action bar. Well here is what I did for mine. In the main method I extended AppCompactActivity and in the method itself I declared the listView as a variable like ListView listView; then after that, in the onCreate method of the main object you just simply connect this to the id of your list using listView = (ListView) findViewById(R.id.thelistid) after that I simply called the adapter that should fill the list with content as listView.setAdapter(nameOfYourAdapter) Hope this helps!


Post a Comment for "Action Bar Shown In Display Of Android Studio But Not In My Actual App"