안드로이드 개발 질문/답변
(글 수 45,052)
이클립스에서 버튼생성 코드 작성 중 유형분석이 불가능하다는 메시지가 출력됩니다.
Subject name : Practice
src/exam.practice/Practice.java
res/layout/buttonedit.xml
다른것들은 전혀 수정하지 않은채로 res에 buttonedit.xml 파일만 생성해서 작성중입니다.
Practice.java의 소스코드입니다.
package exam.practice;
import android.app.*; import android.os.*; import android.view.*; import android.widget.*;
public class Practice extends Activity { /** Called when the activity is first created. */ public class buttonEdit extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.buttonedit); Button btn = (Button)findViewById(R.id.button); btn.setOnClickListener (new Button.OnClickListener() { public void onClick(View v) { EditText edit = (EditText)findViewById(R.id.edit); String str = edit.getText().toString(); Toast.makeText(ButtonEdit.this, str, Toast.LENGTH_SHORT).show(); } }); } } }
buttonedit.xml의 코드입니다.
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" > <EditTexg android:id="@+id/edit" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="여기에 입력하세요" android:scaleType="center" /> <Button android:id="@+id/button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="입력완료" android:scaleType="center" /> </LinearLayout>
에러코드입니다.
[2010-08-04 14:53:03 - Practice] Error in an XML file: aborting build.
-공지사항을 다 읽었습니다^^-
첫질문이 너무 기초라서 좀 부끄럽지만 답변 부탁드립니다^^