Android layout 应用程序停止,但没有错误

Android layout 应用程序停止,但没有错误,android-layout,android-studio,Android Layout,Android Studio,这是错误的新日志,我不明白它是关于什么的,我似乎无法找出这个错误 11-25 15:56:18.773 6776-6776/com.example.ghost.prochat E/UncaughtException:java.lang.RuntimeException:无法启动活动组件信息{com.example.ghost.prochat/com.example.ghost.prochat.MainActivity}:android.view.InflateException:二进制XML文件

这是错误的新日志,我不明白它是关于什么的,我似乎无法找出这个错误

11-25 15:56:18.773 6776-6776/com.example.ghost.prochat E/UncaughtException:java.lang.RuntimeException:无法启动活动组件信息{com.example.ghost.prochat/com.example.ghost.prochat.MainActivity}:android.view.InflateException:二进制XML文件行#2:膨胀类时出错 在android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2204)上 在android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2254)上 在android.app.ActivityThread.access$600(ActivityThread.java:141) 在android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234) 位于android.os.Handler.dispatchMessage(Handler.java:99) 位于android.os.Looper.loop(Looper.java:137) 位于android.app.ActivityThread.main(ActivityThread.java:5069) 位于java.lang.reflect.Method.Invokenactive(本机方法) 位于java.lang.reflect.Method.invoke(Method.java:511) 在com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)上 位于com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) 在dalvik.system.NativeStart.main(本机方法) 原因:android.view.InflateException:二进制XML文件行#2:膨胀类时出错 在android.view.LayoutInflater.createView中(LayoutInflater.java:613) 在com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)上 位于android.view.LayoutInflater.onCreateView(LayoutInflater.java:660) 位于android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685) 在android.view.LayoutInflater.充气(LayoutInflater.java:466) 在android.view.LayoutInflater.inflate(LayoutInflater.java:396) 在android.view.LayoutInflater.充气(LayoutInflater.java:352) 在android.support.v7.app.AppCompateDelegateImplV9.setContentView(AppCompateDelegateImplV9.java:284) 位于android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) 位于com.example.ghost.prochat.MainActivity.onCreate(MainActivity.java:56) 位于android.app.Activity.performCreate(Activity.java:5104) 位于android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1092) 位于android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148) 在android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2254)上 在android.app.ActivityThread.access$600(ActivityThread.java:141) 在android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234) 位于android.os.Handler.dispatchMessage(Handler.java:99) 位于android.os.Looper.loop(Looper.java:137) 位于android.app.ActivityThread.main(ActivityThread.java:5069) 位于java.lang.reflect.Method.Invokenactive(本机方法) 位于java.lang.reflect.Method.invoke(Method.java:511) 在com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)上 位于com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) 在dalvik.system.NativeStart.main(本机方法)
public class MainActivity extends AppCompatActivity implements View.OnClickListener {

    //defining view objects
    private EditText editTextEmail;
    private EditText displayUsername;
    private EditText editTextPassword;
    private Button buttonSignup;


    private TextView textViewSignin;

    private ProgressDialog progressDialog;


    //defining firebaseauth object
    private FirebaseAuth firebaseAuth;
    /**
     * ATTENTION: This was auto-generated to implement the App Indexing API.
     * See https://g.co/AppIndexing/AndroidStudio for more information.
     */
    private GoogleApiClient client;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        //initializing firebase auth object
        firebaseAuth = FirebaseAuth.getInstance();

        //if getCurrentUser does not returns null
        if (firebaseAuth.getCurrentUser() != null) {
            //that means user is already logged in
            //so close this activity
            finish();

            //and open profile activity
            startActivity(new Intent(getApplicationContext(), ProfileActivity.class));
        }

        //initializing views
        editTextEmail = (EditText) findViewById(R.id.editTextEmail);
        displayUsername = (EditText) findViewById(R.id.displayUsername);
        editTextPassword = (EditText) findViewById(R.id.editTextPassword);
        textViewSignin = (TextView) findViewById(R.id.textViewSignin);

        buttonSignup = (Button) findViewById(R.id.buttonSignup);

        progressDialog = new ProgressDialog(this);

        //attaching listener to button
        buttonSignup.setOnClickListener(this);
        textViewSignin.setOnClickListener(this);
        // ATTENTION: This was auto-generated to implement the App Indexing API.
        // See https://g.co/AppIndexing/AndroidStudio for more information.
        client = new GoogleApiClient.Builder(this).addApi(AppIndex.API).build();
    }

    private void registerUser() {


        //getting email and password from edit texts
        String email = editTextEmail.getText().toString().trim();
        String password = editTextPassword.getText().toString().trim();

        //checking if email and passwords are empty
        if (TextUtils.isEmpty(email)) {
            Toast.makeText(this, "Please enter email", Toast.LENGTH_LONG).show();
            return;
        }

        if (TextUtils.isEmpty(password)) {
            Toast.makeText(this, "Please enter password", Toast.LENGTH_LONG).show();
            return;
        }

        //if the email and password are not empty
        //displaying a progress dialog

        progressDialog.setMessage("Registering Please Wait...");
        progressDialog.show();


        //creating a new user
        firebaseAuth.createUserWithEmailAndPassword(email, password)
                .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
                    @Override
                    public void onComplete(@NonNull Task<AuthResult> task) {
                        //checking if success
                        if (task.isSuccessful()) {
                            finish();
                            final FirebaseUser user = task.getResult().getUser();
                            UserProfileChangeRequest profileUpdates = new UserProfileChangeRequest.Builder()
                                    .setDisplayName(String.valueOf(displayUsername))
                                    .setPhotoUri(Uri.parse("https://example.com/jane-q-user/profile.png"))
                                    .build();
                            user.updateProfile(profileUpdates);

                            FirebaseDatabase.getInstance().getReference("users").child(user.getUid()).setValue(UserList.user);
                            startActivity(new Intent(getApplicationContext(), ProfileActivity.class));
                        } else {
                            //display some message here
                            Toast.makeText(MainActivity.this, "Registration Error", Toast.LENGTH_LONG).show();
                        }
                        progressDialog.dismiss();
                    }
                });

    }


    @Override
    public void onClick(View view) {

        if (view == buttonSignup) {
            registerUser();
        }

        if (view == textViewSignin) {
            //open login activity when user taps on the already registered textview
            startActivity(new Intent(this, LoginActivity.class));
        }

    }

    /**
     * ATTENTION: This was auto-generated to implement the App Indexing API.
     * See https://g.co/AppIndexing/AndroidStudio for more information.
     */
    public Action getIndexApiAction() {
        Thing object = new Thing.Builder()
                .setName("Main Page") // TODO: Define a title for the content shown.
                // TODO: Make sure this auto-generated URL is correct.
                .setUrl(Uri.parse("http://[ENTER-YOUR-URL-HERE]"))
                .build();
        return new Action.Builder(Action.TYPE_VIEW)
                .setObject(object)
                .setActionStatus(Action.STATUS_TYPE_COMPLETED)
                .build();
    }

    @Override
    public void onStart() {
        super.onStart();

        // ATTENTION: This was auto-generated to implement the App Indexing API.
        // See https://g.co/AppIndexing/AndroidStudio for more information.
        client.connect();
        AppIndex.AppIndexApi.start(client, getIndexApiAction());
    }

    @Override
    public void onStop() {
        super.onStop();

        // ATTENTION: This was auto-generated to implement the App Indexing API.
        // See https://g.co/AppIndexing/AndroidStudio for more information.
        AppIndex.AppIndexApi.end(client, getIndexApiAction());
        client.disconnect();
    }
}
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/activity_main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/head"
    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="com.example.ghost.prochat.MainActivity">




        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:text="User Registration"
            android:id="@+id/textView"
            android:layout_gravity="center_horizontal" />

        <EditText
            android:id="@+id/displayUsername"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_margin="15dp"
            android:hint="Username"
            android:inputType="textEmailAddress" />

        <EditText
            android:id="@+id/editTextEmail"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_margin="15dp"
            android:hint="Enter email"
            android:inputType="textEmailAddress" />

        <EditText
            android:id="@+id/editTextPassword"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_margin="15dp"
            android:hint="Enter password"
            android:inputType="textPassword" />

        <Button
            android:id="@+id/buttonSignup"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_margin="15dp"
            android:text="Signup" />

        <TextView
            android:text="Already Registered? Signin Here"
            android:id="@+id/textViewSignin"
            android:textAlignment="center"
            android:layout_margin="15dp"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />



</RelativeLayout>
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
<dimen name="activity_vertical_margin">36dp</dimen>