-
Notifications
You must be signed in to change notification settings - Fork 334
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1748 from BoyJDG/master
- Loading branch information
Showing
10 changed files
with
90 additions
and
4 deletions.
There are no files selected for viewing
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.
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,30 @@ | ||
# 第三次实验 | ||
|
||
Android资源使用编程 | ||
|
||
## 1.实验目标 | ||
|
||
掌握在Android应用中使用图片等资源的方法。 | ||
|
||
## 2.实验步骤 | ||
|
||
1.在界面上显示至少一张图片(按照自己的题目添加); | ||
|
||
2.提交res/drawable及图片使用的代码; | ||
|
||
3.提交res/values, res/layout等其他代码; | ||
|
||
3.将应用运行结果截图,放到实验报告中; | ||
|
||
4.点击图片(或按钮)时,打开另一个Activity。 | ||
|
||
// 保存在自己的文件夹下 | ||
## 3.实验结果 | ||
|
||
![image](https://github.com/BoyJDG/android-labs-2018/blob/master/soft1614080902124/QQ%E5%9B%BE%E7%89%8720180510091047.jpg) | ||
|
||
![image](https://github.com/BoyJDG/android-labs-2018/blob/master/soft1614080902124/QQ%E5%9B%BE%E7%89%8720180510091034.jpg) | ||
|
||
## 4.实验体会 | ||
本次实验使用Android Studio编写代码,实现了两个activity,通过此次实验我了解了android一些控件和布局的 | ||
使用,初步了解了控件点击事件的编写。 |
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
18 changes: 18 additions & 0 deletions
18
...pp/src/main/java/edu/hzuapps/androidlabs/soft1614080902124/Soft1614080902124Activity.java
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 |
---|---|---|
@@ -1,13 +1,31 @@ | ||
package edu.hzuapps.androidlabs.soft1614080902124; | ||
|
||
import android.content.Intent; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.os.Bundle; | ||
import android.view.View; | ||
import android.widget.Button; | ||
|
||
|
||
public class Soft1614080902124Activity extends AppCompatActivity { | ||
|
||
Button button = null; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_soft1614080902124); | ||
|
||
button = (Button)findViewById(R.id.button1); | ||
button.setOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View v) { | ||
Intent intent = new Intent(); | ||
intent.setClass(Soft1614080902124Activity.this,Soft1614080902124Activity_2.class); | ||
startActivity(intent); | ||
} | ||
}); | ||
|
||
|
||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
.../src/main/java/edu/hzuapps/androidlabs/soft1614080902124/Soft1614080902124Activity_2.java
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,13 @@ | ||
package edu.hzuapps.androidlabs.soft1614080902124; | ||
|
||
import android.support.v7.app.AppCompatActivity; | ||
import android.os.Bundle; | ||
|
||
public class Soft1614080902124Activity_2 extends AppCompatActivity { | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_soft1614080902124_2); | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
15 changes: 15 additions & 0 deletions
15
soft1614080902124/soft1614080902124/app/src/main/res/layout/activity_soft1614080902124_2.xml
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,15 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
tools:context=".Soft1614080902124Activity_2"> | ||
|
||
<TextView | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="照片浏览器" | ||
android:textSize="50dp" /> | ||
|
||
</android.support.constraint.ConstraintLayout> |
2 changes: 1 addition & 1 deletion
2
soft1614080902124/soft1614080902124/app/src/main/res/values/strings.xml
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<resources> | ||
<string name="app_name">照片浏览器soft1614080902124</string> | ||
<string name="app_name">一</string> | ||
</resources> |