1. You want that $100.00 in your pocket or an Amazon Fire TV don't you? Well here's the deal. With our new updated look we are in desperate need of an updated logo. The 'old' one has certainly served us well, but it's time. Find all the details here: bit.ly/1q0k6Wa
  2. DroidForums.net is currently undergoing a major software upgrade. If you are experiencing any problems logging in please: Contact Us

Help Making App

Discussion in 'Android App Developers' started by DHood, Jan 21, 2010.

  1. DHood

    DHood New Member

    Dec 9, 2009
    Likes Received:
    Trophy Points:

    I've never coded with java before (I know this isn't really java but still). I have coded, ajax, php, javascript, (x)html, css.

    I'm just trying to make something to learn like the basics and get an idea of how to code for android. I'm making an app that starts with a lock screen, you enter a password and then click a button and it either says "Failed" or it takes you to the main screen.

    I have this as my code right now but it's not working (I'm guessing because of the setContentView code at the bottom, I'm trying to figure out how to switch "parts" of the app). Here's my code:

    package com.hood.assistant;
    import android.app.Activity;
    import android.os.Bundle;
    import android.text.Editable;
    import android.view.View;
    import android.widget.Button;
    import android.widget.EditText;
    public class Assistant extends Activity {
    	public EditText myPassword;
        /** Called when the activity is first created. */
        public void onCreate(Bundle savedInstanceState) {
            Button confirmButton = (Button) findViewById(R.id.confirm);
            myPassword = (EditText) findViewById(R.id.EditText01);
            confirmButton.setOnClickListener(new View.OnClickListener()
    			public Editable enteredText;
    			private EditText myResult;
    			public void onClick(View view) {
    				enteredText = myPassword.getText();
    				myResult = (EditText) findViewById(R.id.result);
    				if (enteredText.toString().equals("hood")){
    I got here by messing with Notepad Tutorial. Please, any assistance at all.

    Sorry in advance if this isn't the right place or if there isn't even a place for this...