前言
记录每天学习的内容方便以后自己复习回顾(第一天)。
以下是本篇文章正文内容。
一、URL类的使用?
示例:URL是互联网上“资源”的唯一标识,通常URL由协议名、主机、端口和资源组成,格式组成如下:
protocol://host:port/resourceName
二、使用步骤
1.编写activity_main.xml文件
代码如下(示例):
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
android:layout_margin="20dp"
android:orientation="vertical"
tools:context=".MainActivity">
<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="20sp" />
<EditText
android:id="@+id/et_url"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android