나는 안드로이드 응용 프로그램을 개발 하고이 문제를 어제부터 붙어 왔고 문제가 무엇인지 모르겠습니다.
편집 텍스트는 숫자 입력을받지 않습니다. 내 XML 코드
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:padding="@dimen/dp5">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp15"
android:orientation="horizontal"
android:weightSum="2">
<EditText
android:id="@+id/home_et_code"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.3"
android:hint="@string/code_number"
android:inputType="number"
android:maxLength="18"
android:maxLines="1" />
<Button
android:id="@+id/home_btn_charge"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.7"
android:text="@string/charge"
android:textAppearance="?android:attr/textAppearanceButton"
android:textColor="@color/white"
android:textStyle="bold" />
</LinearLayout></LinearLayout>
제거하면 android:inputType="number"
작동하기 시작하고 입력을 받지만 숫자 입력 만 허용하려면 편집 텍스트가 필요합니다.
나는 아직 자바에서 아무것도 처리하지 않았습니다. 그래서 자바 코드를 추가 할 필요가 없습니다.
참고 : Android> 14에서는 정상적으로 작동하지만 Gingerbread 기기에서는 문제가 발생합니다. 문제는 무엇입니까 ??
이제는 잘 작동합니다. 안드로이드 SDK 플랫폼을 업데이트했기 때문에 편집 텍스트 입력과 같은 많은 문제를 발견했습니다. 뒤로 버튼 누르기가 코드에서 감지되지 않습니다. 하지만 내가해야 할 일은 안드로이드 스튜디오를 닫고 다시 연 다음 애플리케이션을 컴파일하는 것입니다. 마침내 다시 작동합니다 !!
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다