1

I am new to android studio. Yesterday working on project with no problems. But when I opened it today, I am unable to see the design of the pages on the xml section. It says there is a "render problem". My stack trace just says "java.lang.NullPointerException" nothing else.

My xml code:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:theme="@android:style/Theme.DeviceDefault"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingTop="20dp"
android:paddingBottom="20dp"
android:layout_width="match_parent"
android:layout_height="match_parent" >


<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:id="@+id/textView"
    android:layout_alignParentTop="true"
    android:layout_centerHorizontal="true" />

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceMedium"
    android:text="Medium Text"
    android:id="@+id/home_name"
    android:layout_below="@+id/textView"
    android:layout_alignParentStart="true"
    android:layout_alignParentLeft="true"/>

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceMedium"
    android:text="Medium Text"
    android:id="@+id/home_email"
    android:layout_below="@+id/home_name"
    android:layout_alignParentStart="true"
    android:layout_alignParentLeft="true"/>

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceMedium"
    android:text="Medium Text"
    android:id="@+id/home_password"
    android:layout_below="@+id/home_email"
    android:layout_alignParentStart="true"
    android:layout_alignParentLeft="true"/>

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceSmall"
    android:id="@+id/err"
    android:layout_centerVertical="true"
    android:layout_centerHorizontal="true" />

</RelativeLayout>

The java:

package com.example.steph.example;

import android.app.Activity;

    import android.os.Bundle;
    import android.widget.TextView;



public class Home extends Activity {

String name, email, password, Err;
TextView nameTV, emailTV, passwordTV, err;

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

    nameTV = (TextView) findViewById(R.id.home_name);
    emailTV = (TextView) findViewById(R.id.home_email);
    passwordTV = (TextView) findViewById(R.id.home_password);
    err = (TextView) findViewById(R.id.err);

    name = getIntent().getStringExtra("name");
    password = getIntent().getStringExtra("password");
    email = getIntent().getStringExtra("email");
    Err = getIntent().getStringExtra("err");

    nameTV.setText(name);
    passwordTV.setText(password);
    emailTV.setText(email);
    err.setText(Err);


 }

}

Can provide more details if need be

Tom
  • 16,842
  • 17
  • 45
  • 54
S.Carr
  • 11
  • 2

0 Answers0