Ich versuche, auf die Einstellungen zu gehen Bildschirm gefunden. Im Moment wird durch das Drücken des Eintrags nur der Bildschirm aktualisiert, auf dem ich gerade war.Starten eine Aktivität von preferences.xml
sieht mein preferences.xml wie folgt aus:
<Preference
android:title="@string/my_location_settings">
<intent android:action="android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS">
</intent>
</Preference>
Und mein Manifest-Eintrag sieht wie folgt aus:
<activity android:name=".Preferences">
<intent-filter>
<action android:name="android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
Was mache ich falsch?
logcat:
12-11 15:53:34.170: INFO/ActivityManager(173): Starting activity: Intent { act=android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS cmp=com.my.app/.Preferences }
12-11 15:53:34.400: INFO/ActivityManager(173): Displayed activity com.my.app/.Preferences: 229 ms (total 229 ms)
Manifest:
<?xml version="1.0" encoding="utf-8"?>
<activity android:name=".ViewActivity" 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=".MyPageOneActivity">
</activity>
<activity android:name=".MyPageTwoActivity">
</activity>
<activity android:name=".MyPageThreeActivity">
</activity>
<activity android:name=".Preferences">
<intent-filter>
<action android:name="com.my.app.PREFERENCES" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="4" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE">
</uses-permission>
</manifest>
Preferences.java ( traurig über den Mangel an Formatierung):
package com.my.app;
import android.os.Bundle;
import android.preference.PreferenceActivity;
public class Preferences extends PreferenceActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.preferences);
}
}
und preferences.xml:
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<EditTextPreference
android:title="Address 1"
android:key="customURLOne"
android:summary="Enter a new address for 1">
</EditTextPreference>
<EditTextPreference
android:title="Address 2"
android:key="customURLTwo"
android:summary="Enter a new address for 2">
</EditTextPreference>
<EditTextPreference
android:title="Address 3"
android:key="customURLThree"
android:summary="Enter a new address for 3">
</EditTextPreference>
<Preference android:title="@string/my_location_settings">
<intent android:action="android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS">
</intent>
</Preference>
Was sagt der Logcat? Können Sie den Manifest-Eintrag für Ihre Haupteinstellungen posten? Derjenige, zu dem du immer zurückkommst? – EboMike
Dies ist der Manifest-Eintrag für meine Haupteinstellungen, das Logcat: – qubz
12-11 15: 53: 34.170: INFO/ActivityManager (173): Startaktivität: Intent {act = android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS cmp = com. my.app/.Preferences} 12-11 15: 53: 34.400: INFO/ActivityManager (173): Angezeigte Aktivität com.my.app/.Preferences: 229 ms (insgesamt 229 ms) – qubz