forked from hzuapps/android-labs-2018
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
de52a93
commit 7eb64eb
Showing
11 changed files
with
188 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); | ||
|
||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"> | ||
|
||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:orientation="vertical"> | ||
|
||
<LinearLayout | ||
|
||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:orientation="vertical"> | ||
<TextView | ||
|
||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="兼职信息:" | ||
android:layout_gravity="center" | ||
android:textSize="25sp" | ||
android:textColor="#000000"/> | ||
|
||
<EditText | ||
android:id="@+id/message" | ||
android:layout_width="match_parent" | ||
android:layout_height="200dp" | ||
android:ems="500" | ||
android:inputType="text" | ||
android:hint="@string/put_hint" /> | ||
|
||
</LinearLayout> | ||
<LinearLayout | ||
|
||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:orientation="horizontal"> | ||
|
||
<TextView | ||
|
||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
|
||
android:text="姓 名:" | ||
android:textSize="25sp" | ||
android:textColor="#000000"/> | ||
<EditText | ||
android:id="@+id/name" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:ems="10" | ||
android:inputType="textPersonName" /> | ||
|
||
</LinearLayout> | ||
<LinearLayout | ||
|
||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:orientation="horizontal"> | ||
<TextView | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="电话号码:" | ||
android:textSize="25sp" | ||
android:textColor="#000000"/> | ||
<EditText | ||
android:id="@+id/phone" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:ems="10" | ||
android:inputType="phone" /> | ||
</LinearLayout> | ||
|
||
|
||
<Button | ||
android:id="@+id/send" | ||
android:onClick="fabu" | ||
android:layout_marginTop="20sp" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_gravity="center" | ||
android:text="发 布" | ||
android:textSize="30sp"/> | ||
</LinearLayout> | ||
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.