加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Java > 正文

java – E / MotionRecognitionManager:mSContextService导致应

发布时间:2020-12-15 02:17:17 所属栏目:Java 来源:网络整理
导读:这里有一个与此类似的问题: Motion Recognition Manager and motion-Service in android 我问我的是因为有一条评论请求错误发生的代码并且没有提供代码.这是我的第一个问题,所以我希望我没有做错或粗鲁的事情. 我正在开发一个解析RSS源的应用程序,并具有用
这里有一个与此类似的问题: Motion Recognition Manager and motion-Service in android

我问我的是因为有一条评论请求错误发生的代码并且没有提供代码.这是我的第一个问题,所以我希望我没有做错或粗鲁的事情.

我正在开发一个解析RSS源的应用程序,并具有用户可以更改的设置,如背景颜色,文本颜色,用户名.这些设置保存在共享首选项中.

该应用程序在模拟器中完美运行.在之前的迭代中,在我添加共享首选项功能之前,我能够在我的个人三星Galaxy s6手机上运行该应用程序.现在,它不会在我的手机上运行.

我在ListView中显示提要.设置从ListPreferences更改.

我的logcat看起来像这样:

10/30 10:33:34: Launching app
$adb push C:UsersJenniferAndroidStudioProjectsRSSAssignment7appbuildoutputsapkapp-debug.apk /data/local/tmp/com.example.jennifer.rssassignment7

$adb shell pm install -r "/data/local/tmp/com.example.jennifer.rssassignment7"
    pkg: /data/local/tmp/com.example.jennifer.rssassignment7
Success


$adb shell am start -n "com.example.jennifer.rssassignment7/com.example.jennifer.rssassignment7.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Client not ready yet..Waiting for process to come online
Connected to process 14137 on device samsung-sm_g920w8-1215fc28c4943e05

W/System: ClassLoader referenced unknown path: /data/app/com.example.jennifer.rssassignment7-1/lib/arm64

D/InjectionManager: InjectionManager
D/InjectionManager: fillFeatureStoreMap com.example.jennifer.rssassignment7

I/InjectionManager: Constructor com.example.jennifer.rssassignment7,Feature store :{}
I/InjectionManager: featureStore :{}

W/ResourcesManager: getTopLevelResources: /data/app/com.example.jennifer.rssassignment7-1/base.apk / 1.0 running in com.example.jennifer.rssassignment7 rsrc of package com.example.jennifer.rssassignment7

W/ResourcesManager: getTopLevelResources: /data/app/com.example.jennifer.rssassignment7-1/base.apk / 1.0 running in com.example.jennifer.rssassignment7 rsrc of package com.example.jennifer.rssassignment7

W/art: Before Android 4.1,method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter,android.content.res.ColorStateList,android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable

D/AbsListView: Get MotionRecognitionManager

E/MotionRecognitionManager: mSContextService = android.hardware.scontext.ISContextService$Stub$Proxy@8089b26

E/MotionRecognitionManager: motionService = com.samsung.android.motion.IMotionRecognitionService$Stub$Proxy@53d367

E/MotionRecognitionManager: motionService = com.samsung.android.motion.IMotionRecognitionService$Stub$Proxy@53d367

Application terminated.

和一个代码示例,ListPreferences之一:

在preferences.xml中:

<ListPreference
    android:title="Choose Your Text Color"
    android:summary="We'll save your choice for next time."
    android:key="color"
    android:defaultValue="#000000"
    android:entries="@array/colorArray"
    android:entryValues="@array/colorValues" />

在array.xml中:

<!--color array-->
<string-array name="colorArray">
    <item>Black - black text is not visible on a black background</item>
    <item>Burgundy</item>
    <item>Green</item>
    <item>Blue</item>
    <item>White - white text is not visible on a white background</item>
</string-array>

<string-array name="colorValues">
    <item>#000000</item>
    <item>#800020</item>
    <item>#3C8D0D</item>
    <item>#7068FF</item>
    <item>#ffffff</item>
</string-array>

在活动中:

public class MainActivity extends AppCompatActivity { ...

    TextView titleView,descriptionView;

    titleView = (TextView) findViewById(R.id.titleView);

    descriptionView = (TextView) findViewById(R.id.descriptionView);

    //get text color and background color from shared preferences
    SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
    color = prefs.getString("color","1");

    if(!(color == null)) {
        titleView.setTextColor(Color.parseColor(color));
        descriptionView.setTextColor(Color.parseColor(color));
    } else {
        titleView.setTextColor(BLACK);
        descriptionView.setTextColor(BLACK);
    }

和TextViews的xml:

<TextView
    android:layout_width="wrap_content"
    android:id= "@+id/titleView"
    android:layout_height="wrap_content"
    style="@style/CodeFont"
    android:textColor="#000000"/>
<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id= "@+id/descriptionView"
    style="@style/CodeFont"
    android:layout_below="@+id/linkView"/>

我在第一次运行应用程序时将其作为默认设置放入其他地方,共享首选项中没有任何内容保存.我不确定它是否有必要,但是当应用程序在我的手机上崩溃时我添加了它,认为它崩溃的原因是没有存储的设置.

该应用程序安装在我的手机上并立即崩溃.我试着看看它的设置,但是从来没有任何改变.我已经尝试卸载并重新安装该应用程序.同样,它不适用于我的手机,但它在模拟器上完美运行.

任何人都可以提供建议,以帮助我的应用程序在我的手机上运行吗?非常感谢.

解决方法

颜色中的“1”似乎= prefs.getString(“color”,“1”);不是有效的颜色值(支持的格式为:#RRGGBB #AARRGGBB或以下名称之一:’red’,’blue’,’green’,’black’,’white’,’grey’,’cyan’,’ magenta’,’yellow’,’lightgray’,’darkgray’,’lightgrey’,’darkgrey’,’aqua’,’fuchsia’,’lime’,’maroon’,’navy’,’olive’,’紫色’,’银’,’青色’.)看看 Official Documentation

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读