2010-03-26 7 views
0

방금 ​​Android App 용 인터페이스 프로토 타입을 만들어 실행하려고했습니다. 편집Android 프로그래밍 응용 프로그램이 예기치 않게 중지되었습니다.

screenshot http://mobileka.freehostia.com/3.png

이것은 레이아웃 모드 : 불행하게도, 난 내 응용 프로그램이 예기치 않게 중지 오류가 발생합니다.

screenshot http://mobileka.freehostia.com/1.png

이 내 main.xml에 코드입니다 : 내가 너무 오류가 없도록해야 원하는 모든 것이 보이는

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:gravity="top" 
    android:background="@drawable/back" > 
    <TextView 
     android:id="@+id/score" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:text = "@string/scoreT" 
     android:textColor="@string/scoreColor" 
     android:gravity = "left" 
     android:typeface="serif" 
     android:textStyle="bold|italic" 
     android:textSize="16sp" 
     android:paddingLeft = "10px" 
     android:paddingTop="4px"/> 
    <TextView 
     android:id = "@+id/scoreTxt" 
     android:layout_toRightOf="@+id/score" 
     android:textSize="16sp" 
     android:paddingTop = "5px" 
     android:paddingLeft="4px" 
     android:typeface="serif" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:text=" 0" 
     android:textColor="@string/scoreTextColor" 
     android:gravity = "left"/> 
    <TextView 
     android:id = "@+id/scoreSeparator" 
     android:layout_toRightOf="@+id/scoreTxt" 
     android:textSize="16sp" 
     android:paddingTop = "3px" 
     android:paddingLeft="4px" 
     android:typeface="serif" 
     android:textStyle="bold" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:text="|" 
     android:textColor="@string/scoreColor" 
     android:gravity = "left"/> 
    <TextView 
     android:id = "@+id/timerTxt" 
     android:layout_alignParentRight="true" 
     android:textSize="16sp" 
     android:paddingRight="10px" 
     android:paddingTop="4px" 
     android:typeface="serif" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:textColor="@string/scoreTextColor" 
     android:gravity = "right" 
     android:text="00:00" />  
    <TextView 
     android:id = "@+id/timer" 
     android:layout_toLeftOf="@+id/timerTxt" 
     android:textColor="@string/scoreColor" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:textSize="16sp" 
     android:padding = "3px" 
     android:typeface="serif" 
     android:textStyle="bold|italic" 
     android:text="@string/timerT" 
     android:gravity = "left"/> 
    <TextView 
     android:id = "@+id/timerSeparator" 
     android:layout_toLeftOf="@+id/timer" 
     android:textSize="16sp" 
     android:paddingTop = "3px" 
     android:paddingLeft="4px" 
     android:typeface="serif" 
     android:textStyle="bold" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:text="|" 
     android:textColor="@string/scoreColor" 
     android:gravity = "left"/> 
    <ImageButton 
     android:id="@+id/buttonOne" 
     android:layout_below="@+id/score" 
     android:layout_marginTop="40px" 
     android:layout_marginLeft="14px" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:clickable="true" 
     android:src="@drawable/inactive"/> 
    <ImageButton 
     android:id="@+id/buttonTwo" 
     android:layout_toRightOf="@+id/buttonOne" 
     android:layout_marginTop="63px" 
     android:layout_marginLeft="10px" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:src="@drawable/inactive" /> 
    <ImageButton 
     android:id="@+id/buttonThree" 
     android:layout_toRightOf="@+id/buttonTwo" 
     android:layout_marginTop="63px" 
     android:layout_marginLeft="10px" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:src="@drawable/inactive" /> 
    <ImageButton 
     android:id="@+id/buttonFour" 
     android:layout_toRightOf="@+id/buttonThree" 
     android:layout_marginTop="63px" 
     android:layout_marginLeft="10px" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:src="@drawable/inactive" /> 
    <ImageButton 
     android:id="@+id/buttonFive" 
     android:layout_below="@+id/buttonOne" 
     android:layout_marginTop="40px" 
     android:layout_marginLeft="14px" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:src="@drawable/inactive" /> 
    <ImageButton 
     android:id="@+id/buttonSix" 
     android:layout_toRightOf="@+id/buttonFive" 
     android:layout_marginTop="164px" 
     android:layout_marginLeft="10px" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:src="@drawable/inactive" /> 
    <ImageButton 
     android:id="@+id/buttonSeven" 
     android:layout_toRightOf="@+id/buttonSix" 
     android:layout_marginTop="164px" 
     android:layout_marginLeft="10px" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:src="@drawable/inactive" /> 
    <ImageButton 
     android:id="@+id/buttonEight" 
     android:layout_toRightOf="@+id/buttonSeven" 
     android:layout_marginTop="164px" 
     android:layout_marginLeft="10px" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:src="@drawable/inactive" /> 
    <ImageButton 
     android:id="@+id/buttonNine" 
     android:layout_below="@+id/buttonEight" 
     android:layout_marginTop="40px" 
     android:layout_marginLeft="14px" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:src="@drawable/inactive" /> 
    <ImageButton 
     android:id="@+id/buttonTen" 
     android:layout_toRightOf="@+id/buttonNine" 
     android:layout_marginTop="264px" 
     android:layout_marginLeft="10px" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:src="@drawable/inactive" /> 
    <ImageButton 
     android:id="@+id/buttonEleven" 
     android:layout_toRightOf="@+id/buttonTen" 
     android:layout_marginTop="264px" 
     android:layout_marginLeft="10px" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:src="@drawable/inactive" /> 
    <ImageButton 
     android:id="@+id/buttonTwelve" 
     android:layout_toRightOf="@+id/buttonEleven" 
     android:layout_marginTop="264px" 
     android:layout_marginLeft="10px" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:src="@drawable/inactive" />  
</RelativeLayout> 

그리고 이것은 12 내 로그 캣 오류 (PS 행 번호입니다 main.xml에 최초의 텍스트 뷰)


03-26 22:59:31.670: WARN/dalvikvm(185): threadid=3: thread exiting with uncaught exception (group=0x4001b188) 
03-26 22:59:31.727: ERROR/AndroidRuntime(185): Uncaught handler: thread main exiting due to uncaught exception 
03-26 22:59:31.784: ERROR/AndroidRuntime(185): java.lang.RuntimeException: Unable to start activity ComponentInfo{kz.androidmarket.www.randomtest1/kz.androidmarket.www.randomtest1.randomTest1}: android.view.InflateException: Binary XML file line #12: Error inflating class <unknown> 
03-26 22:59:31.784: ERROR/AndroidRuntime(185):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496) 
03-26 22:59:31.784: ERROR/AndroidRuntime(185):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512) 
03-26 22:59:31.784: ERROR/AndroidRuntime(185):  at android.app.ActivityThread.access$2200(ActivityThread.java:119) 
03-26 22:59:31.784: ERROR/AndroidRuntime(185):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863) 
03-26 22:59:31.784: ERROR/AndroidRuntime(185):  at android.os.Handler.dispatchMessage(Handler.java:99) 
03-26 22:59:31.784: ERROR/AndroidRuntime(185):  at android.os.Looper.loop(Looper.java:123) 
03-26 22:59:31.784: ERROR/AndroidRuntime(185):  at android.app.ActivityThread.main(ActivityThread.java:4363) 
03-26 22:59:31.784: ERROR/AndroidRuntime(185):  at java.lang.reflect.Method.invokeNative(Native Method) 
03-26 22:59:31.784: ERROR/AndroidRuntime(185):  at java.lang.reflect.Method.invoke(Method.java:521) 
03-26 22:59:31.784: ERROR/AndroidRuntime(185):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860) 
03-26 22:59:31.784: ERROR/AndroidRuntime(185):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 
03-26 22:59:31.784: ERROR/AndroidRuntime(185):  at dalvik.system.NativeStart.main(Native Method) 
03-26 22:59:31.784: ERROR/AndroidRuntime(185): Caused by: android.view.InflateException: Binary XML file line #12: Error inflating class <unknown> 
03-26 22:59:31.784: ERROR/AndroidRuntime(185):  at android.view.LayoutInflater.createView(LayoutInflater.java:513) 
03-26 22:59:31.784: ERROR/AndroidRuntime(185):  at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56) 
03-26 22:59:31.784: ERROR/AndroidRuntime(185):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563) 
03-26 22:59:31.784: ERROR/AndroidRuntime(185):  at android.view.LayoutInflater.rInflate(LayoutInflater.java:618) 
03-26 22:59:31.784: ERROR/AndroidRuntime(185):  at android.view.LayoutInflater.inflate(LayoutInflater.java:407) 
03-26 22:59:31.784: ERROR/AndroidRuntime(185):  at android.view.LayoutInflater.inflate(LayoutInflater.java:320) 
03-26 22:59:31.784: ERROR/AndroidRuntime(185):  at android.view.LayoutInflater.inflate(LayoutInflater.java:276) 
03-26 22:59:31.784: ERROR/AndroidRuntime(185):  at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198) 
03-26 22:59:31.784: ERROR/AndroidRuntime(185):  at android.app.Activity.setContentView(Activity.java:1622) 
03-26 22:59:31.784: ERROR/AndroidRuntime(185):  at kz.androidmarket.www.randomtest1.randomTest1.onCreate(randomTest1.java:11) 
03-26 22:59:31.784: ERROR/AndroidRuntime(185):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 
03-26 22:59:31.784: ERROR/AndroidRuntime(185):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459) 
03-26 22:59:31.784: ERROR/AndroidRuntime(185):  ... 11 more 
03-26 22:59:31.784: ERROR/AndroidRuntime(185): Caused by: java.lang.reflect.InvocationTargetException 
03-26 22:59:31.784: ERROR/AndroidRuntime(185):  at android.widget.TextView.<init>(TextView.java:320) 
03-26 22:59:31.784: ERROR/AndroidRuntime(185):  at java.lang.reflect.Constructor.constructNative(Native Method) 
03-26 22:59:31.784: ERROR/AndroidRuntime(185):  at java.lang.reflect.Constructor.newInstance(Constructor.java:446) 
03-26 22:59:31.784: ERROR/AndroidRuntime(185):  at android.view.LayoutInflater.createView(LayoutInflater.java:500) 
03-26 22:59:31.784: ERROR/AndroidRuntime(185):  ... 22 more 
03-26 22:59:31.784: ERROR/AndroidRuntime(185): Caused by: android.content.res.Resources$NotFoundException: File #ffff9900 from drawable resource ID #0x7f040002: .xml extension required 
03-26 22:59:31.784: ERROR/AndroidRuntime(185):  at android.content.res.Resources.loadColorStateList(Resources.java:1820) 
03-26 22:59:31.784: ERROR/AndroidRuntime(185):  at android.content.res.TypedArray.getColorStateList(TypedArray.java:289) 
03-26 22:59:31.784: ERROR/AndroidRuntime(185):  at android.widget.TextView.<init>(TextView.java:627) 
03-26 22:59:31.784: ERROR/AndroidRuntime(185):  ... 26 more 
012,317,

아무도 도와 줄 수 있습니까?

+0

이미지 링크가 끊어졌습니다. 어쩌면 스택 오버플로 이미지 업 로더를 사용하여 이미지를 다시 추가 한 다음 다시 열어 플래그를 지정할 수 있습니다. – Kev

답변

8

관련 에러는 다음 색 리소스 아닌 문자열 리소스로

android:textColor="@string/scoreColor" 

textColor 요구 :에 상당

03-26 22:59:31.784: ERROR/AndroidRuntime(185): Caused by: android.content.res.Resources$NotFoundException: File #ffff9900 from drawable resource ID #0x7f040002: .xml extension required 

.

관련 문제