first app 튜토리얼을 수행하려고합니다. 2 xml 파일, activity_main 및 문자열을 편집 한 후 지침에 "이클립스에서 도구 모음에서 실행을 클릭하십시오."실행을 클릭하면 Eclipse에서 Android 앱을 실행하지 않습니다.
먼저, 몇 가지 문제점을 보여주었습니다. EditText를 android:layout_weight="1"
으로 설정하면 android:layout_height
이 wrap_content
으로 설정되지 않아서 Problems 탭에 나를 보여줍니다. layout_height를 너비와 같이 0dp로 설정하면 문제가 사라집니다.
둘째, 이제는 문제 목록에 아무 것도 보여주지 않았으므로 실행은 Windows 컴퓨터 나 usb를 통해 연결된 안드로이드 장치에서 아무 것도하지 않습니다. 이전 지침에 따라 설정하십시오.
비슷한 질문이있는 다른 스레드를 찾았습니다. 그들은 자신의 AndroidManifest.xml과 MainActivity.java를 살펴 보라고 제안했다. 내 것이 거기에 있어야한다고 제안한 것을 포함하고있는 것 같습니다. 오! 나는 열렬한 열정을 본다. 그러나 아무 말도하지 않는 것 같다.
activity_main.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
<EditText android:id = "@+id/edit_message"
android:layout_weight="1"
android:layout_width = "0dp"
android:layout_height = "0dp"
android:hint="@string/edit_message"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text = "@string/button_send"/>
</LinearLayout>
strings.xml의
이 오류를 재현 할 수<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">My First App</string>
<string name="action_settings">Settings</string>
<string name="edit_message">Edit your message, silly.</string>
<string name="button_send">Send</string>
<string name="title_activity_man">MainActivity</string>
</resources>
기기가 감지 되었습니까? 그것은 당신의 프로젝트를 구축합니까? –
프로젝트가 선택되었는지 확인하십시오 : 프로젝트를 클릭하십시오 -> 실행을 클릭하십시오 – Tobiel
DDMS 탭에서 adb를 리셋하거나 좋은 'ol => 디바이스 연결을 끊고, Eclipse를 종료하고, 디바이스를 다시 연결하십시오 (먼저). 여러분의 머신이이를 인식하고 Eclipse를 다시 시작하십시오. – ChiefTwoPencils