画面の向きを固定する [画面]
ManifestファイルのActivityの要素にandroid:screenOrientationで設定する。
<application android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="true"> <activity android:name=".MainActivity" android:label="@string/app_name" android:screenOrientation="landscape">
http://developer.android.com/intl/ja/guide/topics/manifest/activity-element.html#screen
【2011年9月17日発売】SONY ソニー タブレット 『Sony Tablet』Sシリーズ用クレードル SGPDS1
- ショップ: いーでじ楽天市場店
戻るボタンを制御する [ボタン]
戻るボタンを強制的に制御できる。
public boolean dispatchKeyEvent(KeyEvent e) { if (e.getKeyCode() == KeyEvent.KEYCODE_BACK) { //ここで制御したい処理を書く。 if (e.getAction() == KeyEvent.ACTION_DOWN) { return false; } return true; } return super.dispatchKeyEvent(e); }
見れば分かるが、何も戻るボタンに限った話ではない。
タグ:ボタン