0

当我通过智能扩展模拟器打开我的首选项时,在选项卡控件下的扩展首选项菜单中,单击 SampleControlExtension 设置。我得到:

android.content.ActivityNotFoundException: Unable to find explicit activity class {com.sonyericsson.extras.liveware.extension.q/com.sonyericsson.extras.liveware.extension.q.SamplePreferenceActivity}; have you declared this activity in your AndroidManifest.xml?

此组合在 SmartWatch 模拟器中不起作用:

   ...
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.sonyericsson.extras.liveware.extension"
  android:versionName="1.0.1" android:versionCode="10001">
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="10"/>

<uses-permission
    android:name="com.sonyericsson.extras.liveware.aef.EXTENSION_PERMISSION" />

<application android:icon="@drawable/icon" android:label="@string/app_name">
    <activity android:name=".q.SamplePreferenceActivity" android:label="@string/preference_activity_title">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
        </intent-filter>
    </activity>

    <service android:name=".controlsample.SampleExtensionService" />

    <receiver android:name=".controlsample.ExtensionReceiver">
       <intent-filter>
        ...

看起来像 SmartWatch 模拟器中的错误?

代码链接

堆栈跟踪:

01-21 13:01:05.963: E/AndroidRuntime(3295): FATAL EXCEPTION: main
01-21 13:01:05.963: E/AndroidRuntime(3295): android.content.ActivityNotFoundException:        Unable to find explicit activity class {com.sonyericsson.extras.liveware.extension.q/com.sonyericsson.extras.liveware.extension.q.SamplePreferenceActivity}; have you declared this activity in your AndroidManifest.xml?
01-21 13:01:05.963: E/AndroidRuntime(3295):     at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1541)
01-21 13:01:05.963: E/AndroidRuntime(3295):     at android.app.Instrumentation.execStartActivity(Instrumentation.java:1416)
01-21 13:01:05.963: E/AndroidRuntime(3295):     at android.app.Activity.startActivityForResult(Activity.java:3351)
01-21 13:01:05.963: E/AndroidRuntime(3295):     at android.app.Activity.startActivityForResult(Activity.java:3312)
01-21 13:01:05.963: E/AndroidRuntime(3295):     at android.app.Activity.startActivity(Activity.java:3522)
01-21 13:01:05.963: E/AndroidRuntime(3295):     at android.app.Activity.startActivity(Activity.java:3490)
01-21 13:01:05.963: E/AndroidRuntime(3295):     at com.sonyericsson.extras.liveware.emulator.ExtensionPreferenceActivity$1.onPreferenceClick(ExtensionPreferenceActivity.java:87)
01-21 13:01:05.963: E/AndroidRuntime(3295):     at android.preference.Preference.performClick(Preference.java:944)
01-21 13:01:05.963: E/AndroidRuntime(3295):     at android.preference.PreferenceScreen.onItemClick(PreferenceScreen.java:208)
01-21 13:01:05.963: E/AndroidRuntime(3295):     at android.widget.AdapterView.performItemClick(AdapterView.java:298)
01-21 13:01:05.963: E/AndroidRuntime(3295):     at android.widget.AbsListView.performItemClick(AbsListView.java:1086)
01-21 13:01:05.963: E/AndroidRuntime(3295):     at android.widget.AbsListView$PerformClick.run(AbsListView.java:2855)
01-21 13:01:05.963: E/AndroidRuntime(3295):     at android.widget.AbsListView$1.run(AbsListView.java:3529)
01-21 13:01:05.963: E/AndroidRuntime(3295):     at android.os.Handler.handleCallback(Handler.java:615)
01-21 13:01:05.963: E/AndroidRuntime(3295):     at android.os.Handler.dispatchMessage(Handler.java:92)
01-21 13:01:05.963: E/AndroidRuntime(3295):     at android.os.Looper.loop(Looper.java:137)
01-21 13:01:05.963: E/AndroidRuntime(3295):     at android.app.ActivityThread.main(ActivityThread.java:4745)
01-21 13:01:05.963: E/AndroidRuntime(3295):     at java.lang.reflect.Method.invokeNative(Native Method)
01-21 13:01:05.963: E/AndroidRuntime(3295):     at java.lang.reflect.Method.invoke(Method.java:511)
01-21 13:01:05.963: E/AndroidRuntime(3295):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
01-21 13:01:05.963: E/AndroidRuntime(3295):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
01-21 13:01:05.963: E/AndroidRuntime(3295):     at dalvik.system.NativeStart.main(Native Method)
4

1 回答 1

1

我已经下载了您的示例代码,导入到 Eclipse 等,但无法重现您遇到的问题。你还有吗?

和一般性评论 - 您实现的扩展是一个小部件扩展,因此它不应该在模拟器的“控制”选项卡中可见。所以,我很好奇你怎么能在这个标签下找到扩展。

也许您可以用更多信息更新您的问题,也许还有更多堆栈跟踪信息?

更新:

我已经做了一些测试,很明显模拟器在上面示例的具体情况下并没有表现出应有的行为。我现在将检查智能扩展 SDK 的更新时间表,看看我们是否可以发布修复。

于 2013-01-07T10:55:46.013 回答