user1396620
user1396620

Reputation: 21

FATAL EXCEPTION: Main Android Eclipse

this is my code and sends me an error (FATAL EXCEPTION: Main), I would like to help me thank you very much

here is my code from Activity.java

package hola.mundo;

import android.app.Activity;
import android.os.Bundle;

public class HolaActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }
}

here my code from main.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="horizontal" >

    <EditText android:id="@+id/edit_message"
        android:layout_weight="1"
        android:layout_width="0dp"
        android:hint="@string/edit_message" />

    <Button android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/button_send"/>

</LinearLayout>

and strings.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>

    <string name="app_name">Hola</string>
    <string name="edit_message">Enter a Message</string>
    <string name="button_send">Send</string>

</resources>

plz anyone can help me

Upvotes: 2

Views: 1143

Answers (1)

Amokrane Chentir
Amokrane Chentir

Reputation: 30385

You don't have a layout_height defined for edit_message (instead you have: layout_weight). Also, your layout will probably not look like you expected but that's another question (and it depends on your requirements which I ignore right now).

Upvotes: 4

Related Questions