0

I am developing an android application. I want it so that when a user creates an account, the application takes the user input from the New member class, and creates output in another class. For example, The user puts in their Name. And on the application home screen which is a whole different class, they are able to see, "Hello %name%! what would you like to do today?"Here I have my new user class.

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

public class NewScreen extends Activity {


EditText textEdit4;
EditText textEdit5;
EditText editText3;

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

    textEdit4 = (EditText) findViewById(R.id.textEdit4);

    textEdit5 = (EditText) findViewById(R.id.textEdit5);

    editText3 = (EditText) findViewById(R.id.editText3);




    Button btn_submit = (Button) findViewById(R.id.btn_submit);
    btn_submit.setOnClickListener(new OnClickListener() {
        public void onClick(View v) {
            Intent intent = new Intent();
            intent.setClassName("net.contents.fbla", "net.contents.fbla.NewScreen2");
            startActivity(intent);
        }
    });


}
    }
    `

and my XML for said class

<TextView
    android:id="@+id/textView4"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/email_string" />

<EditText
    android:id="@+id/textEdit4"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:ems="10"
    android:inputType="textEmailAddress" >

    <requestFocus />
</EditText>

<TextView
    android:id="@+id/textView5"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/pass_string" />

<EditText
    android:id="@+id/textEdit5"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:ems="10"
    android:inputType="textPassword" />

<TextView
    android:id="@+id/textView3"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/name" />

<EditText
    android:id="@+id/editText3"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:ems="10"
    android:inputType="textPersonName" />

<Button
    android:id="@+id/btn_submit"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:text="@string/btn_submit" />

<ProgressBar
    android:id="@+id/progressBar1"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />

Any help will do! Thanks -Jeremy

1 Answers1

0

You really need all your classes in a package.Android - Package Name convention in your src folder in eclipse you probably already have your classes in the default package this is no good. Create a new package under src by convention the name of your package is reverse url of your website because this is sure to be unique only use period not slash.example com.stackoverflow. Now in your source code add package com.stackoverflow ; as the very first line in your java.only don't use stackoverflow cause that's an example

Community
  • 1
  • 1