krishna
krishna

Reputation: 609

Cannot see the action bar in my mainactivity which extends an activity

My activity extends

public class MainActivity extends Activity {}

and my manifest contains

manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.connectingtonetwork"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="12"
android:targetSdkVersion="21" />

and my styles contains

<style name="AppBaseTheme" parent="@android:Theme.Holo>

still I cant see the action bar.my min sdk is 12 so according to developer guide I am using Theme.Halo.I hope someone can help me with this

Upvotes: 0

Views: 1668

Answers (3)

krishna
krishna

Reputation: 609

I figured out the problem(s) and it does not matter if you extends ActionBarActivity or Activity(using one of these depends on what min sdk version you are supporting) 1.I did not inflate the menu items 2.I did not use the correct theme for the activity.

Upvotes: 0

Thiago Souto
Thiago Souto

Reputation: 771

You can create a Custom design from you actionbar or you can set the icon in android manifest for each activity!

Usually you don't need inherit from ActionBarActivity, but you can inherit for a theme with a actionbar or use getActionbar().show() in you code :)

Links: How can I implement custom Action Bar with custom buttons in Android?

Good luck

Upvotes: 0

NeviQ-OR
NeviQ-OR

Reputation: 305

You may want to inherit your MainActivity from ActionBarActivity

Also please look here for complete picture.

Upvotes: 1

Related Questions