<activityここでは「MySamplePrefActivity」という名前のクラスとしてアクティビティを追加してあります。このように、PreferenceActivityを利用する場合には、そのための<activity>タグを用意しておく必要があります。
android:name=".MySamplePrefActivity"
android:label="pref">
</activity>
※リストが表示されない場合
AddBlockなどの広告ブロックツールがONになっているとリストなどが表示されない場合があります。これらのツールをOFFにしてみてください。
※AndroidManifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="jp.tuyano.sample" android:versionCode="1" android:versionName="1.0"> <application android:icon="@drawable/icon" android:debuggable="true" android:label="@string/app_name"> <activity android:name=".MySample" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name=".MySamplePrefActivity" android:label="pref"> </activity> </application> <uses-sdk android:minSdkVersion="4" /> </manifest> ※main.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" xmlns:app="http://schemas.android.com/apk/res/jp.tuyano.sample" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TextView android:id="@+id/TextView01" android:text="OK" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textSize="12pt" /> </LinearLayout>
次へ >> |