intent

第七次作业 (手机充值)

痴心易碎 提交于 2019-12-02 07:01:42
作业一:用数据传递和回传实现以下充值功能。 <?xml version="1.0" encoding="utf-8"?> <RelativeLayout 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="wrap_content" android:orientation="horizontal" android:layout_above="@id/textview" > <TextView android:layout_width="0dp" android:layout_height="wrap_content" android:text="手机号码" android:layout_weight="1" /> <EditText android:id="@+id/edittext" android:layout_width="0dp" android:layout_height="wrap_content" android

Android:Intent与IntentFilter 解析

柔情痞子 提交于 2019-12-02 05:35:38
说明 : 一直不明白Inten tFilter的作用,于是上网找资料。发现大家的说明都很难明白,没有举例说明。 对于IntentFilter的说明,我引用 h3c4lenovo 的: Android Intent action有什么用??? 一文进行说明... 以下是引文的大意(有修改): 1、 场景 在讲action之前,我跟大家回忆一个场景。 比如说我在某个App中点击拍照,会跳转到照相机的界面。但是当我新装了camer360或之类的第三方照相app 的 时 候 再点击照相就会先弹出一个Dialog来让我选择是使用默认camer还是camer360 。 2、 显式Intent 和 隐式Intent( 根据场景来理解 ) <1> 显式Intent:明确指出了目标组件名称的Intent 显式Intent直接用组件的名称定义目标组件,这种方式很直接。但是由于开发人员往往并不清楚别的应程序的组件名称。因此,显式Intent更多用于在应用程序内部传递消息。 如: Intent intent = new Intent(MainActivity.this,BActivity.class); <2> 隐式Intent:没有明确指出目标组件名称的Intent 隐式Intent它不会用组件名称定义需要激活的目标组件,它更广泛地用于在不同应用程序之间传递消息。 如果要跳转到一个未知路径

第八次作业

≯℡__Kan透↙ 提交于 2019-12-02 05:27:29
package com.example.workeight; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.EditText; import android.widget.TextView; import androidx.appcompat.app.AppCompatActivity; public class Main2Activity extends AppCompatActivity { private TextView tv_number; private EditText et_money; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main2); tv_number = findViewById(R.id.tv_number); et_money = findViewById(R.id.et_money); Intent intent = getIntent(); tv_number

关于android的监听器

老子叫甜甜 提交于 2019-12-02 05:09:37
import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Button; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button button1=(Button)findViewById(R.id.button1); button1.setOnClickListener(new View.OnClickListener() {@Override public void onClick(View v) { Intent intent=new Intent(MainActivity.this,Main2Activity.class); startActivity(intent); }});

android 连接wifi案例

那年仲夏 提交于 2019-12-02 05:07:03
1、xml布局文件: <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context="com.example.helloword.WifiTestActivity" > <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginBottom=

第七次作业2

只谈情不闲聊 提交于 2019-12-02 04:50:42
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout 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=".MainActivity"> <TextView android:id="@+id/text1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="40dp" android:layout_marginTop="120dp" android:text="手机号码" /> <EditText android:id="@+id/tb_1" android:layout_width="wrap_content" android:layout

第七次作业

本秂侑毒 提交于 2019-12-02 03:43:12
<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity"> <LinearLayout android:layout_width="match_parent" android:layout_height="60dp" android:layout_marginLeft="20dp" android:layout_marginTop="60dp" android:layout_marginRight="20dp" android:gravity="center"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="手机号码:" android:textColor="@android

第七次作业

一曲冷凌霜 提交于 2019-12-02 03:38:41
所需截图: 所需代码: package com.example.myapplication;import android.content.Intent;import android.graphics.Color;import android.os.Bundle;import android.text.SpannableStringBuilder;import android.text.Spanned;import android.text.style.ForegroundColorSpan;import android.view.View;import android.widget.EditText;import android.widget.TextView;import androidx.annotation.Nullable;import androidx.appcompat.app.AppCompatActivity;public class MainActivity extends AppCompatActivity { private EditText et_number; private TextView tv_show; @Override protected void onCreate(Bundle savedInstanceState) { super

第七次作业-话费充值

自作多情 提交于 2019-12-02 03:17:52
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout 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="wrap_content" android:orientation="horizontal" android:layout_above="@id/textview" > <TextView android:layout_width="0dp" android:layout_height="wrap_content" android:text="手机号码" android:layout_weight="1" /> <EditText android:id="@+id/edittext" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="5" />

作业七

∥☆過路亽.° 提交于 2019-12-02 03:16:51
package com.example.demo01; import android.support.v7.app.ActionBarActivity; import android.content.Intent; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.EditText; import android.widget.TextView; public class MainActivity extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } public void click(View v) { EditText et1=(EditText)findViewById(R.id.eT1); String S= et1.getText().toString(); Intent intent