Skip to content

Commit

Permalink
hzuapps#6 hzuapps#154 第六次作业
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown authored and unknown committed Jun 11, 2017
1 parent c4c917e commit 58f12f3
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
package edu.hzuapps.androidlabs.homeworks.net1414080903131;

import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

Expand All @@ -12,6 +16,7 @@ public class Net1414080903131MainActivity extends AppCompatActivity {

Button btLogin;
Button btRegister;
Button btJson;

EditText etUsername;
EditText etPassword;
Expand All @@ -22,16 +27,30 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_net1414080903131_main);
btLogin= (Button) findViewById(R.id.bt_login);
btRegister= (Button) findViewById(R.id.bt_register);
btJson= (Button) findViewById(R.id.bt_json);

etUsername= (EditText) findViewById(R.id.et_id);
etPassword= (EditText) findViewById(R.id.et_password);

String username=etUsername.getText().toString();
String password=etPassword.getText().toString();
if (check(username,password)){
startActivity(new Intent(Net1414080903131MainActivity.this,Net1414080903131MenuActivity.class));
}

btJson.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(Net1414080903131MainActivity.this,Net1414080903131ShowJsonActivity.class));
}
});


}


public boolean check(String name,String password){
if (name.equals("linzihong")&&password.equals("123456")){
return true;
}return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
android:src="@drawable/stu_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="60dp"/>
android:layout_marginBottom="10dp"
android:id="@+id/imageView" />

<TextView
android:gravity="center_horizontal"
Expand All @@ -20,7 +21,7 @@
android:textSize="30sp"/>

<LinearLayout
android:layout_marginTop="20dp"
android:layout_marginTop="10dp"
android:paddingLeft="60dp"
android:paddingRight="60dp"
android:gravity="center_horizontal"
Expand Down Expand Up @@ -83,4 +84,16 @@
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:id="@+id/bt_register" />

<Button
android:background="@color/colorPrimary"
android:textColor="#ffffff"
android:text="解析json数据"
android:textSize="20sp"
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:id="@+id/bt_json" />
</LinearLayout>

1 comment on commit 58f12f3

@linzihong888
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3d4cc1d9da671b85cf972f1817a3958e
59c908cb2018d59d44d0940d33f37008

Please sign in to comment.