
处理下一个页面的应答数据,详细步骤说明如下:
(1)上一个页面打包好请求数据,调用startActivityForResult方法执行跳转动作
(2)下一个页面接收并解析请求数据,进行相应处理
(3)下一个页面在返回上一个页面时,打包应答数据并调用setResult方法返回数据包裹
(4)上一个页面重写方法onActivityResult,解析获得下一个页面的返回数据
==========================================================================================
第一个页面:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/tv_request"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:textColor="#000000"
android:textSize="17sp" />
<Button
android:id="@+id/btn_request"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="传送请求数据"
android:textColor="#000000"
android:textSize="17sp" />
<TextView
android:id="@+id/tv_response"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="5dp"
android:textColor="#000000"
android:textSize="17sp" />
</LinearLayout>
package com.example.myapplication;
import android.app.Activity;
import android.

最低0.47元/天 解锁文章
5308





