我有一个想要从偏好屏幕加载的活动。我收到以下错误:
06-23 16:12:00.470: E/AndroidRuntime(3410): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.polygonattraction.app/com.polygonattraction.app.functions.GetImageActivity}; have you declared this activity in your AndroidManifest.xml?
我的偏好屏幕代码:
<PreferenceScreen
android:title="Get faces"
android:summary="Get the faces.">
<intent
android:targetClass="com.polygonattraction.app.functions.GetImageActivity"
android:targetPackage="com.polygonattraction.app"
/>
</PreferenceScreen>
我要加载的活动
public class GetImageActivity extends Activity
{
public void onCreate()
{
System.out.println("Started activity...");
setContentView(R.layout.actilayout); //not done yet
}
}
这也是我的清单:
<uses-sdk android:minSdkVersion="7" />
<application
android:icon="@drawable/icon"
android:label="@string/app_name"
>
<service
android:label="@string/app_name"
android:name=".LiveService"
android:permission="android.permission.BIND_WALLPAPER"
>
<intent-filter android:priority="1">
<action android:name="android.service.wallpaper.WallpaperService" />
</intent-filter>
<meta-data android:name="android.service.wallpaper" android:resource="@xml/wallpaper" />
</service>
<activity
android:label="settings"
android:name="com.polygonattraction.app.functions.Settings"
android:exported="true">
</activity>
</application>
我不擅长这个 Android XML 的东西,我习惯于触发 2d 图形编程。为什么他们把事情弄得这么乱?