I was trying to display user input and password in second activity but I got an error unfortunatly login has stopped...
I am getting an error java.lang.nullpointerException : attempt to invoke virtual method'void android.widget.TextView.setText(java.lang.ChaeSequence)' on a null object reference. 

Main class.

```
public class MainActivity extends Activity implements View.OnClickListener
{

    EditText userName;
    EditText password;
    Button loginButton;

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

        userName = (EditText) findViewById(R.id.editText);
        password = (EditText) findViewById(R.id.editText2);
        loginButton = (Button) findViewById(R.id.button);
        loginButton.setOnClickListener(this);

        FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
        fab.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
                        .setAction("Action", null).show();
            }
        });
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu)
    {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item)
    {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();
        //noinspection SimplifiableIfStatement
        if (id == R.id.action_settings)
        {
            return true;
        }

        return super.onOptionsItemSelected(item);
    }

    public void onClick(View view)
    {
            String userStr = userName.getText().toString();
            String passStr = password.getText().toString();
            Intent intent = new Intent(MainActivity.this, SecondAcivity.class);
            intent.putExtra("userName", userStr);
            intent.putExtra("password", passStr);
            startActivity(intent);
    }

```

Second Class.

```
public class SecondAcivity extends MainActivity
{
 @Override
    protected void onCreate(Bundle savedInstanceState)
    {

            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_second_acivity);

             TextView  textView = (TextView) findViewById(R.id.textView);
             Intent intent = getIntent();
             String  userName = intent.getStringExtra("userName");
             String password = intent.getStringExtra("password");
             textView.setText("User Name: " + userName + " Password: " + password);

            FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
            fab.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
                            .setAction("Action", null).show();
                }
            });

    }

```