Fourth iteration goal completion and impressions

Source: Internet
Author: User

The completion of the third iteration target is as follows:

First, account information . the interface is designed as follows:

The main XML code is :

<tablelayout xmlns:android= "Http://schemas.android.com/apk/res/android"
xmlns:tools= "Http://schemas.android.com/tools"
android:layout_width= "Match_parent"
android:layout_height= "Match_parent"
tools:context= "Com.edg.foodie.activity.SettingPasswdActivity" >
<TableRow>
<textview
android:layout_width= "Match_parent"
android:layout_height= "Wrap_content"
android:text= "Initial password:"
android:textsize= "20SP"
/>
<edittext
android:layout_width= "Match_parent"
android:layout_height= "Wrap_content"
android:hint= "Please enter the initial password"
android:selectallonfocus= "true"
/>
</TableRow>
<TableRow>
<textview
android:layout_width= "Match_parent"
android:layout_height= "Wrap_content"
android:text= "Change Password:"
android:textsize= "20SP"
/>
<edittext
android:layout_width= "Match_parent"
android:layout_height= "Wrap_content"
android:hint= "Please enter the password to be modified"
android:selectallonfocus= "true"
/>
</TableRow>

</TableLayout>  The main Java code is as follows:Package com.edg.foodie.activity;
import Android.app.AlertDialog;
import Android.content.DialogInterface;
import android.content.Intent;
import Android.graphics.Color;
import android.support.v7.app.AppCompatActivity;
import Android.os.Bundle;
import Android.view.View;
import android.widget.TableLayout;
import Android.widget.TextView;
import Android.widget.Toast;

import COM.EDG.FOODIE.R;

Public class Accountactivity extends Appcompatactivity {

private TextView TextView;

@Override
protected void OnCreate (Bundle savedinstancestate) {
super.oncreate (savedinstancestate);
Setcontentview (r.layout.activity_account);

TextView = (textView) Findviewbyid (R.id.dlbutton);
Textview.setonclicklistener (New View.onclicklistener () {
@Override
Public void OnClick (View v) {

tablelayout setpasswd = (tablelayout) getlayoutinflater (). Inflate (R.LAYOUT.ACTIVITY_SETTING_PASSWD, nul l);
new Alertdialog.builder (accountactivity.this). Settitle ("Change Password"). Setview (SETPASSWD). Setpositivebutton (" New Dialoginterface.onclicklistener () {
@Override
Public void OnClick (dialoginterface dialog, int which) {
Toast.maketext (Accountactivity.this, "modified successfully", Toast.length_short). Show ();
                    }
}). Setnegativebutton ("Cancel", new Dialoginterface.onclicklistener () {
@Override
Public void OnClick (dialoginterface dialog, int which) {
finish ();
                    }
}). Create (). Show ();
            }

//Intent Intent = new Intent (accountactivity.this, settingpasswdactivity.class);
//Startactivityforresult (intent, 1);

        });
    }

@Override
protected void Onactivityresult (int requestcode, int resultcode, Intent data) {
//Determine if the request code is the request code used to start activity B
if (Requestcode = = 1) {
//Determine if the return code is successful
if (ResultCode = = RESULT_OK) {
if (ResultCode = = RESULT_OK) {
Textview.settext ("set");
Textview.settextcolor (color.red);
            }
        }
    }
}

This is the last iteration of this project, and for this iteration, the interface design was done smoothly, but the Java part took a long time to complete, Read the last semester of the textbook, check the information, also searched the internet a lot of similar code, finally finished my fourth this iteration goal, but also very thanks to my little friends for their help.

Fourth iteration goal completion and impressions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.