2017-09-09 1 views
0

:글고 치기 (안드로이드) 복사에 문제가 EDITTEXT에 텍스트를 복사 할 때 나는이 오류를 받고 있어요

Exception java.lang.NumberFormatException: Invalid int: "res/drawable/edit_text_material.xml" 
java.lang.Integer.invalidInt (Integer.java:138) 
java.lang.Integer.parse (Integer.java:410) 
java.lang.Integer.parseInt (Integer.java:367) 
com.android.internal.util.XmlUtils.convertValueToInt (XmlUtils.java:133) 
android.content.res.TypedArray.getInt (TypedArray.java:357) 
android.view.animation.Animation.<init> (Animation.java:248) 
android.view.animation.AnimationSet.<init> (AnimationSet.java:81) 
android.view.animation.AnimationUtils.createAnimationFromXml (AnimationUtils.java:117) 
android.view.animation.AnimationUtils.createAnimationFromXml (AnimationUtils.java:95) 
android.view.animation.AnimationUtils.loadAnimation (AnimationUtils.java:76) 
android.widget.Editor$SelectionPopupWindow.createAnimations (Editor.java:4086) 
android.widget.Editor$ActionPinnedPopupWindow.<init> (Editor.java:2543) 
android.widget.Editor$ActionPopupWindow.<init> (Editor.java:3577) 
android.widget.Editor$SelectionPopupWindow.<init> (Editor.java:4074) 
android.widget.Editor$SelectionHandleView.getActionPopupWindow (Editor.java:5337) 
android.widget.Editor$SelectionModifierCursorController.show (Editor.java:5305) 
android.widget.Editor.startSelectionActionMode (Editor.java:1715) 
android.widget.Editor.performLongClick (Editor.java:1020) 

android.app.ActivityThread.main (ActivityThread.java:5438) 
java.lang.reflect.Method.invoke (Method.java) 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:738) 
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:628) 

이 내 레이아웃입니다 :

 <android.support.design.widget.TextInputLayout 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_marginBottom="10dp" 
       android:textColorHint="#565d66"> 

       <EditText 
        android:id="@+id/userEditText" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:hint="@string/registration.hint.user" 
        android:textColor="#565d66" 
        android:theme="@style/Custom.EditText" /> 

      </android.support.design.widget.TextInputLayout> 



// this is the theme i'm using in editText: 

     <style name="Custom.EditText" parent="Base.Widget.AppCompat.EditText"> 
     <item name="colorControlNormal">#565d66</item> 
     <item name="colorControlHighlight">@color/colorPrimary</item> 
     <item name="colorControlActivated">@color/colorPrimary</item> 
    </style> 

안드로이드 버전 : 6.0. 1, device : redmi note 4

+2

당신이 당신의 자바 코드를 공유하시기 바랍니다 수보십시오. –

+0

어디에서'edit_text_material' 테마를 사용하고 있습니까 ?? – mrid

+0

예외가 분명합니다 : 숫자로 경로를 구문 분석하려고합니다 –

답변

1

글쎄,이 문제가 발생하고 스타일 부모를 제거하여 문제를 해결합니다.

<style name="Custom.EditText"> 
    <item name="colorControlNormal">#565d66</item> 
    <item name="colorControlHighlight">@color/colorPrimary</item> 
    <item name="colorControlActivated">@color/colorPrimary</item> 
</style> 

오류의 원인은 각 스마트 폰 공급 업체가 맞춤 UI를 만들고 편집 텍스트에 기본 스타일을 사용해야한다는 것입니다.

스타일을 추가하지 않고 텍스트를 복사하려고 시도하십시오. 사용자 정의 스타일을 가진 것과 비교해보십시오. 컨텍스트 메뉴가 이상합니다.

PS : 내 나쁜 영어

0

당신은 추가 컬러 자원에 대한 죄송합니다.

<color name="customEditText">#565d66</color> 

귀하의 스타일 코드를 수정하십시오.

<style name="Custom.EditText" parent="Base.Widget.AppCompat.EditText"> 
    <item name="colorControlNormal">@color/customEditText</item> 
    <item name="colorControlHighlight">@color/colorPrimary</item> 
    <item name="colorControlActivated">@color/colorPrimary</item> 
</style> 

는이

관련 문제