diff --git a/soft1614080902117/app/src/main/AndroidManifest.xml b/soft1614080902117/app/src/main/AndroidManifest.xml
index bc62d3619..dd9d3f598 100644
--- a/soft1614080902117/app/src/main/AndroidManifest.xml
+++ b/soft1614080902117/app/src/main/AndroidManifest.xml
@@ -16,7 +16,8 @@
-
+
+
\ No newline at end of file
diff --git a/soft1614080902117/app/src/main/java/edu/hzuapps/androidlabs/soft1614080902117/Soft1614080902117Activity.java b/soft1614080902117/app/src/main/java/edu/hzuapps/androidlabs/soft1614080902117/Soft1614080902117Activity.java
index 70af752fc..9f4289af7 100644
--- a/soft1614080902117/app/src/main/java/edu/hzuapps/androidlabs/soft1614080902117/Soft1614080902117Activity.java
+++ b/soft1614080902117/app/src/main/java/edu/hzuapps/androidlabs/soft1614080902117/Soft1614080902117Activity.java
@@ -1,21 +1,16 @@
package edu.hzuapps.androidlabs.soft1614080902117;
+import android.app.Activity;
import android.content.Intent;
-
import android.os.Bundle;
-
import android.view.View;
-
+import android.widget.ArrayAdapter;
import android.widget.Button;
-import android.app.Activity;
-
+import android.widget.ListView;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
-import java.lang.String;
-import android.widget.ArrayAdapter;
-import android.widget.ListView;
public class Soft1614080902117Activity extends Activity {
String[] adapterData;
@@ -39,6 +34,14 @@ public void onClick(View v) {
thisActivity.startActivity(intent);
}
});
+ Button btnDlow = (Button)findViewById(R.id.button8);
+ btnDlow.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Intent intent = new Intent(thisActivity,Soft1614080902117Activity2.class);
+ thisActivity.startActivity(intent);
+ }
+ });
}
public String load(){ //读取文件
FileInputStream in =null;
diff --git a/soft1614080902117/app/src/main/java/edu/hzuapps/androidlabs/soft1614080902117/Soft1614080902117Activity2.java b/soft1614080902117/app/src/main/java/edu/hzuapps/androidlabs/soft1614080902117/Soft1614080902117Activity2.java
new file mode 100644
index 000000000..ac507899b
--- /dev/null
+++ b/soft1614080902117/app/src/main/java/edu/hzuapps/androidlabs/soft1614080902117/Soft1614080902117Activity2.java
@@ -0,0 +1,73 @@
+package edu.hzuapps.androidlabs.soft1614080902117;
+
+import android.app.Activity;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.os.Bundle;
+import android.os.Environment;
+import android.os.Handler;
+import android.os.Message;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.ImageView;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+public class Soft1614080902117Activity2 extends Activity {
+ private EditText editText;
+ private Button button;
+ private ImageView imageView;
+ private Bitmap bitmap;
+ Handler handler=new Handler(){
+ public void handleMessage(Message msg) {
+ if(msg.what==111){
+ imageView.setImageBitmap(bitmap);
+ }
+ };
+ };
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_soft16140809021172);
+ editText=(EditText) findViewById(R.id.editweb);
+ button=(Button) findViewById(R.id.button7);
+ imageView=(ImageView) findViewById(R.id.imageView);
+ button.setOnClickListener(new OnClickListener() {
+ public void onClick(View arg0) {
+ new Thread(t).start();
+ }
+ });
+ }
+ Thread t=new Thread(){
+ public void run() {
+ String iPath=editText.getText().toString();
+ try {
+ URL url=new URL(iPath);
+ InputStream inputStream=url.openStream();
+ bitmap=BitmapFactory.decodeStream(inputStream);
+ handler.sendEmptyMessage(111);
+ inputStream.close();
+ inputStream=url.openStream();
+ File file=new File(Environment.getExternalStorageDirectory()+"/DCIM/");
+ FileOutputStream fileOutputStream=new FileOutputStream(file);
+ int hasRead=0;
+ while((hasRead=inputStream.read())!=-1){
+ fileOutputStream.write(hasRead);
+ }
+ fileOutputStream.close();
+ inputStream.close();
+ } catch (MalformedURLException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ };
+ };
+
+}
\ No newline at end of file
diff --git a/soft1614080902117/app/src/main/layout/activity_soft1614080902117.xml b/soft1614080902117/app/src/main/layout/activity_soft1614080902117.xml
index 181ce8099..cb1251dec 100644
--- a/soft1614080902117/app/src/main/layout/activity_soft1614080902117.xml
+++ b/soft1614080902117/app/src/main/layout/activity_soft1614080902117.xml
@@ -33,20 +33,6 @@
-
+
-
-
@@ -113,20 +83,66 @@
android:id="@+id/button2"
android:layout_width="27dp"
android:layout_height="25dp"
- android:layout_marginBottom="4dp"
+ android:layout_marginBottom="16dp"
android:layout_marginEnd="8dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginStart="8dp"
- android:layout_marginTop="8dp"
android:background="@drawable/shezhi"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintHorizontal_bias="0.678"
- app:layout_constraintStart_toEndOf="@+id/button"
- app:layout_constraintTop_toTopOf="parent"
- app:layout_constraintVertical_bias="0.975" />
+ app:layout_constraintHorizontal_bias="0.779"
+ app:layout_constraintStart_toStartOf="parent" />
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/soft1614080902117/app/src/main/layout/activity_soft16140809021172.xml b/soft1614080902117/app/src/main/layout/activity_soft16140809021172.xml
new file mode 100644
index 000000000..6c5efb29f
--- /dev/null
+++ b/soft1614080902117/app/src/main/layout/activity_soft16140809021172.xml
@@ -0,0 +1,82 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file