Created
April 13, 2014 07:03
-
-
Save ColeMurray/10572505 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LoginScreen extends Activity { | |
Button createButton = (Button) findViewById(R.id.uButton); | |
EditText uField = (EditText) findViewById(R.id.uField); | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_login_screen); | |
getUsername(); | |
if (savedInstanceState == null) { | |
getFragmentManager().beginTransaction() | |
.add(R.id.container, new PlaceholderFragment()).commit(); | |
} | |
} | |
private void getUsername() | |
{ | |
createButton.setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View view) | |
{ | |
Toast toast = Toast.makeText(getApplicationContext(), uField.getText().toString(), Toast.LENGTH_LONG); | |
toast.show(); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment