Last active
August 29, 2015 14:20
-
-
Save SelvinPL/48ce075a671ba34f6af7 to your computer and use it in GitHub Desktop.
Minimal working example ... without NPE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'com.android.application' | |
android { | |
compileSdkVersion 22 | |
buildToolsVersion "22.0.1" | |
defaultConfig { | |
applicationId "pl.selvin.android.actionbar14" | |
minSdkVersion 14 | |
targetSdkVersion 22 | |
versionCode 1 | |
versionName "1.0" | |
} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="pl.selvin.android.actionbar14" > | |
<application | |
android:label="ActionBar14" | |
android:theme="@android:style/Theme.Holo.Light"> | |
<activity | |
android:name="pl.selvin.android.actionbar14.MainActivity" | |
android:label="ActionBar14" > | |
<intent-filter> | |
<action android:name="android.intent.action.MAIN" /> | |
<category android:name="android.intent.category.LAUNCHER" /> | |
</intent-filter> | |
</activity> | |
</application> | |
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package pl.selvin.android.actionbar14; | |
import android.app.ActionBar; | |
import android.app.Activity; | |
import android.os.Bundle; | |
public class MainActivity extends Activity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
getActionBar().setIcon(android.R.drawable.ic_dialog_email); | |
getActionBar().setDisplayHomeAsUpEnabled(true); | |
getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment