diff --git "a/students/com1714080901118/\345\256\236\351\252\214\345\233\233/app/src/main/AndroidManifest.xml" "b/students/com1714080901118/\345\256\236\351\252\214\345\233\233/app/src/main/AndroidManifest.xml" new file mode 100644 index 000000000..82f0c1f79 --- /dev/null +++ "b/students/com1714080901118/\345\256\236\351\252\214\345\233\233/app/src/main/AndroidManifest.xml" @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git "a/students/com1714080901118/\345\256\236\351\252\214\345\233\233/app/src/main/java/edu/hzuapps/androidlabs/Com1714080901118/DetailActivity.java" "b/students/com1714080901118/\345\256\236\351\252\214\345\233\233/app/src/main/java/edu/hzuapps/androidlabs/Com1714080901118/DetailActivity.java" new file mode 100644 index 000000000..70ad99169 --- /dev/null +++ "b/students/com1714080901118/\345\256\236\351\252\214\345\233\233/app/src/main/java/edu/hzuapps/androidlabs/Com1714080901118/DetailActivity.java" @@ -0,0 +1,29 @@ +package com.example.aishop; + +import android.os.Bundle; +import android.support.design.widget.FloatingActionButton; +import android.support.design.widget.Snackbar; +import android.support.v7.app.AppCompatActivity; +import android.support.v7.widget.Toolbar; +import android.view.View; + +public class DetailActivity extends AppCompatActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_detail); + Toolbar toolbar = findViewById(R.id.toolbar); + setSupportActionBar(toolbar); + + FloatingActionButton fab = findViewById(R.id.fab); + fab.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG) + .setAction("Action", null).show(); + } + }); + } + +} diff --git "a/students/com1714080901118/\345\256\236\351\252\214\345\233\233/app/src/main/java/edu/hzuapps/androidlabs/Com1714080901118/MainActivity.java" "b/students/com1714080901118/\345\256\236\351\252\214\345\233\233/app/src/main/java/edu/hzuapps/androidlabs/Com1714080901118/MainActivity.java" new file mode 100644 index 000000000..41dbacf34 --- /dev/null +++ "b/students/com1714080901118/\345\256\236\351\252\214\345\233\233/app/src/main/java/edu/hzuapps/androidlabs/Com1714080901118/MainActivity.java" @@ -0,0 +1,32 @@ +package com.example.aishop; + +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.EditText; + +public class MainActivity extends AppCompatActivity { +private EditText et_name; +private Button btn_send; + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + et_name=(EditText)findViewById(R.id.et_name); + btn_send=(Button)findViewById(R.id.btn_send); + btn_send.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + passDate(); + } + }); + } + + private void passDate() { + Intent intent=new Intent(this,ShowActivity.class); + intent.putExtra("the moon and sixpence",et_name.getText().toString().trim()); + startActivity(intent); + } +} diff --git "a/students/com1714080901118/\345\256\236\351\252\214\345\233\233/app/src/main/java/edu/hzuapps/androidlabs/Com1714080901118/ShowActivity.java" "b/students/com1714080901118/\345\256\236\351\252\214\345\233\233/app/src/main/java/edu/hzuapps/androidlabs/Com1714080901118/ShowActivity.java" new file mode 100644 index 000000000..14be27efc --- /dev/null +++ "b/students/com1714080901118/\345\256\236\351\252\214\345\233\233/app/src/main/java/edu/hzuapps/androidlabs/Com1714080901118/ShowActivity.java" @@ -0,0 +1,35 @@ +package com.example.aishop; + +import android.content.Intent; +import android.os.Bundle; +import android.support.design.widget.FloatingActionButton; +import android.support.design.widget.Snackbar; +import android.support.v7.app.AppCompatActivity; +import android.support.v7.widget.Toolbar; +import android.view.View; +import android.widget.TextView; +import org.w3c.dom.Text; + +public class ShowActivity extends AppCompatActivity { + + private TextView tv_name; + private TextView textView; + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_show); + Intent intent=getIntent(); + String name=intent.getStringExtra("the moon and sixpence"); + tv_name=(TextView)findViewById(R.id.tv_name); + tv_name.setText("bookname:"+name); + textView=(TextView)findViewById(R.id.sp); + textView.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent intent=new Intent(ShowActivity.this,DetailActivity.class); + startActivity(intent); + } + }); + } + +} diff --git "a/students/com1714080901118/\345\256\236\351\252\214\345\233\233/app/src/main/res/layout/activity_detail.xml" "b/students/com1714080901118/\345\256\236\351\252\214\345\233\233/app/src/main/res/layout/activity_detail.xml" new file mode 100644 index 000000000..cf5df7b8f --- /dev/null +++ "b/students/com1714080901118/\345\256\236\351\252\214\345\233\233/app/src/main/res/layout/activity_detail.xml" @@ -0,0 +1,33 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git "a/students/com1714080901118/\345\256\236\351\252\214\345\233\233/app/src/main/res/layout/activity_main.xml" "b/students/com1714080901118/\345\256\236\351\252\214\345\233\233/app/src/main/res/layout/activity_main.xml" new file mode 100644 index 000000000..8ddfc8be2 --- /dev/null +++ "b/students/com1714080901118/\345\256\236\351\252\214\345\233\233/app/src/main/res/layout/activity_main.xml" @@ -0,0 +1,59 @@ + + + + + + + + + + +