我對Android非常陌生,並且無法顯示我的PreferenceScreen
活動的標頭。我要顯示這樣安卓中「PreferenceScreen」的標題/標題缺失
我的類聲明是這樣的
public class SettingsActivity extends PreferenceActivity
和onCreate
這樣
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
_settingsFragment = new SettingsFragment();
getFragmentManager().beginTransaction().replace(android.R.id.content, _settingsFragment).commit();
}
的preferences.xml
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<Preference
android:key="pref_key_vault_storage"
android:title="Vault Storage"
android:summary="Set/modify the vault storage location." >
<intent
android:targetPackage="com.test.concealx"
android:targetClass="com.test.concealx.ChooseStorageActivity"/>
</Preference>
<EditTextPreference
android:id="@+id/id_path"
android:title="Vault Path"
android:key="pref_key_vault_path"
android:summary="Set/modify the storage path. DO NOT change this unless you are sure about it.">
</EditTextPreference>
</PreferenceScreen>
標題
我現在得到的是這種
我已經在PreferenceActivity無濟於事試圖android:title="My Settings"
和setTitle
。任何幫助,將不勝感激。
HTTPS:/ /stackoverflow.com/a/6714971/6050536 – Ali
@Ali我試過了,它不是工作國王之一:-( –