From 7eb64ebb2c1f32e5f00fee039230a11281291a8b Mon Sep 17 00:00:00 2001 From: chinesehope <741713720@qq.com> Date: Sat, 2 Jun 2018 16:56:44 +0800 Subject: [PATCH 1/6] =?UTF-8?q?#5=20=E5=AE=9E=E9=AA=8C5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- soft1614080902345/App/Java/MainActivity.java | 12 ++- soft1614080902345/App/Java/Run2.java | 51 +++++++++++ .../App/Main/AndroidManifest.xml | 7 ++ .../App/res/layout/activity_main.xml | 42 +++++++-- soft1614080902345/App/res/layout/run2.xml | 86 ++++++++++++++++++ soft1614080902345/App/res/values/strings.xml | 1 + ...351\252\2145\346\210\252\345\233\2761.jpg" | Bin 0 -> 250905 bytes ...351\252\2145\346\210\252\345\233\2762.jpg" | Bin 0 -> 127564 bytes ...351\252\2145\346\210\252\345\233\2763.jpg" | Bin 0 -> 134682 bytes ...351\252\2145\346\210\252\345\233\2764.jpg" | Bin 0 -> 136349 bytes ...351\252\2145\346\210\252\345\233\2765.jpg" | Bin 0 -> 16825 bytes 11 files changed, 188 insertions(+), 11 deletions(-) create mode 100644 soft1614080902345/App/Java/Run2.java create mode 100644 soft1614080902345/App/res/layout/run2.xml create mode 100644 "soft1614080902345/\345\256\236\351\252\2145\346\210\252\345\233\2761.jpg" create mode 100644 "soft1614080902345/\345\256\236\351\252\2145\346\210\252\345\233\2762.jpg" create mode 100644 "soft1614080902345/\345\256\236\351\252\2145\346\210\252\345\233\2763.jpg" create mode 100644 "soft1614080902345/\345\256\236\351\252\2145\346\210\252\345\233\2764.jpg" create mode 100644 "soft1614080902345/\345\256\236\351\252\2145\346\210\252\345\233\2765.jpg" diff --git a/soft1614080902345/App/Java/MainActivity.java b/soft1614080902345/App/Java/MainActivity.java index 57cb6db40..bc70e251a 100644 --- a/soft1614080902345/App/Java/MainActivity.java +++ b/soft1614080902345/App/Java/MainActivity.java @@ -7,13 +7,14 @@ import android.widget.Button; public class MainActivity extends AppCompatActivity { - private Button runbutton; + private Button runbutton,run2button; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); - runbutton=(Button) findViewById(R.id.button); + runbutton=(Button) findViewById(R.id.button1); + run2button=(Button) findViewById(R.id.button2); runbutton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { @@ -21,6 +22,13 @@ public void onClick(View v) { startActivity(intent); } }); + run2button.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent intent =new Intent(MainActivity.this,Run2.class); + startActivity(intent); + } + }); } } diff --git a/soft1614080902345/App/Java/Run2.java b/soft1614080902345/App/Java/Run2.java new file mode 100644 index 000000000..508c42818 --- /dev/null +++ b/soft1614080902345/App/Java/Run2.java @@ -0,0 +1,51 @@ +package com.example.administrator; + +import android.app.Activity; +import android.content.ContentUris; +import android.content.ContentValues; +import android.content.Intent; +import android.content.SharedPreferences; +import android.database.Cursor; +import android.database.sqlite.SQLiteDatabase; +import android.os.Bundle; +import android.util.Log; +import android.view.View; +import android.widget.Button; +import android.widget.EditText; +import android.widget.ShareActionProvider; +import android.widget.Toast; + +public class Run2 extends Activity{ + private Button send; + private EditText name,message,phone; + private SharedPreferences pref; + private SharedPreferences.Editor editor; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.run2); + name=(EditText)findViewById(R.id.name); + message=(EditText)findViewById(R.id.message); + phone=(EditText)findViewById(R.id.phone); + send=(Button)findViewById(R.id.send); + pref=getSharedPreferences("JZmessage",MODE_PRIVATE); + editor=pref.edit(); + + } + public void fabu(View v){ + switch (v.getId()){ + case R.id.send: + String Name=name.getText().toString(); + String Message=message.getText().toString(); + String Phone=phone.getText().toString(); + editor.putString("发布人姓名",Name); + editor.putString("发布人电话",Phone); + editor.putString("兼职信息",Message); + editor.commit(); + Toast.makeText(Run2.this,"登记成功",Toast.LENGTH_LONG).show(); + + + } + } +} diff --git a/soft1614080902345/App/Main/AndroidManifest.xml b/soft1614080902345/App/Main/AndroidManifest.xml index 9f7d2d66f..4816d3a13 100644 --- a/soft1614080902345/App/Main/AndroidManifest.xml +++ b/soft1614080902345/App/Main/AndroidManifest.xml @@ -24,6 +24,13 @@ android:label="@string/run_name"> + + + + \ No newline at end of file diff --git a/soft1614080902345/App/res/layout/activity_main.xml b/soft1614080902345/App/res/layout/activity_main.xml index 5c30e997e..ee60415bd 100644 --- a/soft1614080902345/App/res/layout/activity_main.xml +++ b/soft1614080902345/App/res/layout/activity_main.xml @@ -9,14 +9,38 @@ android:label="@string/app_name" > + + + +