diff --git a/students/soft1714080902216/edu/hzuapps/androidlabs/soft1714080902216/Soft1714080902216DataActivity.java b/students/soft1714080902216/edu/hzuapps/androidlabs/soft1714080902216/Soft1714080902216DataActivity.java index ddab55cab..0b518d866 100644 --- a/students/soft1714080902216/edu/hzuapps/androidlabs/soft1714080902216/Soft1714080902216DataActivity.java +++ b/students/soft1714080902216/edu/hzuapps/androidlabs/soft1714080902216/Soft1714080902216DataActivity.java @@ -1,7 +1,11 @@ package edu.hzuapps.androidlabs.soft1714080902216; +import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; +import android.view.View; +import android.widget.Button; +import android.widget.ImageButton; public class Soft1714080902216DataActivity extends AppCompatActivity { @@ -9,5 +13,27 @@ public class Soft1714080902216DataActivity extends AppCompatActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_soft1714080902216_data); + Button inputLogin=(Button) findViewById(R.id.inputLogin); + Button Comeback=(Button) findViewById(R.id.Comeback); + inputLogin.setOnClickListener(new Soft1714080902216DataActivity.MyButton()); + Comeback.setOnClickListener(new Soft1714080902216DataActivity.MyButton()); + } + + private class MyButton implements View.OnClickListener + { + @Override + public void onClick(View v) + { + Intent intent; + switch(v.getId()) + { + case R.id.inputLogin: + break; + case R.id.Comeback: + intent=new Intent(Soft1714080902216DataActivity.this,Soft1714080902216MainActivity.class); + startActivity(intent); + break; + } + } } } diff --git a/students/soft1714080902216/edu/hzuapps/androidlabs/soft1714080902216/Soft1714080902216MainActivity.java b/students/soft1714080902216/edu/hzuapps/androidlabs/soft1714080902216/Soft1714080902216MainActivity.java index ec1d4ad8b..9ecbb6f25 100644 --- a/students/soft1714080902216/edu/hzuapps/androidlabs/soft1714080902216/Soft1714080902216MainActivity.java +++ b/students/soft1714080902216/edu/hzuapps/androidlabs/soft1714080902216/Soft1714080902216MainActivity.java @@ -6,6 +6,7 @@ import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Button; +import android.widget.ImageButton; public class Soft1714080902216MainActivity extends AppCompatActivity { @@ -13,23 +14,37 @@ public class Soft1714080902216MainActivity extends AppCompatActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); + Button Record=(Button) findViewById(R.id.button1); + ImageButton User= (ImageButton) findViewById(R.id.imageButton); + Button Data=(Button) findViewById(R.id.button2); + Record.setOnClickListener(new MyButton()); + User.setOnClickListener(new MyButton()); + Data.setOnClickListener(new MyButton()); } - public void Record(View view) + private class MyButton implements View.OnClickListener { - Intent intent=new Intent(this,Soft1714080902216RecordActivity.class); - startActivity(intent); + @Override + public void onClick(View v) + { + Intent intent; + switch(v.getId()) + { + case R.id.button1: + intent=new Intent(Soft1714080902216MainActivity.this,Soft1714080902216RecordActivity.class); + startActivity(intent); + break; + case R.id.button2: + intent=new Intent(Soft1714080902216MainActivity.this,Soft1714080902216DataActivity.class); + startActivity(intent); + break; + case R.id.imageButton: + intent=new Intent(Soft1714080902216MainActivity.this,Soft1714080902216UserActivity.class); + startActivity(intent); + break; + } + } } - public void User(View view) - { - Intent intent=new Intent(this,Soft1714080902216UserActivity.class); - startActivity(intent); - } - public void Data(View view) - { - Intent intent=new Intent(this,Soft1714080902216DataActivity.class); - startActivity(intent); - } } diff --git a/students/soft1714080902216/edu/hzuapps/androidlabs/soft1714080902216/Soft1714080902216RecordActivity.java b/students/soft1714080902216/edu/hzuapps/androidlabs/soft1714080902216/Soft1714080902216RecordActivity.java index a1a0cd0a6..6d2283785 100644 --- a/students/soft1714080902216/edu/hzuapps/androidlabs/soft1714080902216/Soft1714080902216RecordActivity.java +++ b/students/soft1714080902216/edu/hzuapps/androidlabs/soft1714080902216/Soft1714080902216RecordActivity.java @@ -1,4 +1,40 @@ package edu.hzuapps.androidlabs.soft1714080902216; -public class Soft1714080902216RecordActivity { +import android.content.Intent; +import android.support.v7.app.AppCompatActivity; +import android.os.Bundle; +import android.view.View; +import android.widget.Button; +import android.widget.ImageButton; + +import static edu.hzuapps.androidlabs.soft1714080902216.R.*; + +public class Soft1714080902216RecordActivity extends AppCompatActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_soft1714080902216_record); + Button inputLogin = (Button) findViewById(R.id.inputLogin); + Button Comeback = (Button) findViewById(R.id.Comeback); + inputLogin.setOnClickListener(new Soft1714080902216RecordActivity.MyButton()); + Comeback.setOnClickListener(new Soft1714080902216RecordActivity.MyButton()); + } + + private class MyButton implements View.OnClickListener { + @Override + public void onClick(View v) { + Intent intent; + switch (v.getId()) { + case R.id.inputLogin: + break; + case R.id.Comeback: + intent = new Intent(Soft1714080902216RecordActivity.this, Soft1714080902216MainActivity.class); + startActivity(intent); + break; + } + } + } } + + diff --git a/students/soft1714080902216/edu/hzuapps/androidlabs/soft1714080902216/Soft1714080902216Remind.java b/students/soft1714080902216/edu/hzuapps/androidlabs/soft1714080902216/Soft1714080902216Remind.java new file mode 100644 index 000000000..a25ccf4c7 --- /dev/null +++ b/students/soft1714080902216/edu/hzuapps/androidlabs/soft1714080902216/Soft1714080902216Remind.java @@ -0,0 +1,4 @@ +package edu.hzuapps.androidlabs.soft1714080902216; + +public class Soft1714080902216Remind { +} diff --git a/students/soft1714080902216/edu/hzuapps/androidlabs/soft1714080902216/Soft1714080902216UserActivity.java b/students/soft1714080902216/edu/hzuapps/androidlabs/soft1714080902216/Soft1714080902216UserActivity.java index 18e465894..efe346abd 100644 --- a/students/soft1714080902216/edu/hzuapps/androidlabs/soft1714080902216/Soft1714080902216UserActivity.java +++ b/students/soft1714080902216/edu/hzuapps/androidlabs/soft1714080902216/Soft1714080902216UserActivity.java @@ -1,7 +1,11 @@ package edu.hzuapps.androidlabs.soft1714080902216; +import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; +import android.view.View; +import android.widget.Button; +import android.widget.ImageButton; public class Soft1714080902216UserActivity extends AppCompatActivity { @@ -9,5 +13,31 @@ public class Soft1714080902216UserActivity extends AppCompatActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_soft1714080902216_user); + Button denglu=(Button) findViewById(R.id.denglu); + Button zhuce= (Button) findViewById(R.id.zhuce); + Button back=(Button) findViewById(R.id.back); + denglu.setOnClickListener(new Soft1714080902216UserActivity.myButton()); + zhuce.setOnClickListener(new Soft1714080902216UserActivity.myButton()); + back.setOnClickListener(new Soft1714080902216UserActivity.myButton()); + } + + private class myButton implements View.OnClickListener + { + @Override + public void onClick(View v) + { + Intent intent; + switch(v.getId()) + { + case R.id.button1: + break; + case R.id.button2: + break; + case R.id.imageButton: + intent=new Intent(Soft1714080902216UserActivity.this,Soft1714080902216MainActivity.class); + startActivity(intent); + break; + } + } } } diff --git a/students/soft1714080902216/layout/activity_main.xml b/students/soft1714080902216/layout/activity_main.xml index abeea1721..167b5920a 100644 --- a/students/soft1714080902216/layout/activity_main.xml +++ b/students/soft1714080902216/layout/activity_main.xml @@ -1,6 +1,6 @@ - + android:text="记录" /> +