APIDEMO里面的redirection示例本身并没有新技术,里面用到的知识点在前面的几个文章中都已涉及到:
- SharedPreferences
- startActivityForResult
redirection demo主要展示的是根据不同的条件跳转到特定的activity
里面使用到的几个关键点
1、SharedPreferences
//SharedPreferences 的保存
SharedPreferences sharedPreferences = getSharedPreferences("RedirectData", 0);
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putString("text", inpuTextView.getText().toString());
if (editor.commit()) {
setResult(RESULT_OK);
}
//SharedPreferences 的读取
SharedPreferences preferences = getSharedPreferences("RedirectData", 0);
String mTextPref = preferences.getString("text", null);
2、打开activity获取结果
//打开方法
startActivityForResult(new Intent(RedirectMain.this,RedirectInput.class), REQUEST_CODE);
//获取结果方法
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// TODO Auto-generated method stub
super.onActivityResult(requestCode, resultCode, data);
if (REQUEST_CODE == requestCode && resultCode == RESULT_OK) {
SharedPreferences preferences = getSharedPreferences("RedirectData", 0);
String mTextPref = preferences.getString("text", null);
textView.setText("用户输入:" + mTextPref);
}
}
//被打开的activity返回结果
SharedPreferences sharedPreferences = getSharedPreferences("RedirectData", 0);
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putString("text", inpuTextView.getText().toString());
if (editor.commit()) {
setResult(RESULT_OK);
}
finish();
效果图:
- 大小: 32.4 KB
分享到:
相关推荐
-iOS(+ IL2CPP 64 bit, IPv6), tvOS, Android -Windows Phone 10, Windows Store Apps, UWP -Windows, Mac OS X, Linux Most notable HTTP features are: -Customize all parts of your requests: -+Methods(GET, ...
Laravel开发-laravel-redirection 重定向页面。
VMware Horizon Geolocation Redirection扩展程序使安装在Horizon远程桌面/应用程序中的Chrome浏览器可以使用客户端设备的地理位置信息。 重要说明:VMware Horizon地理位置重定向需要VMware Horizo...
简单重定向服务 ... gh_auth_callback : "/-/gh-auth" , //must be the same as set in your GitHub Application gh_scope : 'user, public_repo' , //https://developer.github.com/v3/oauth/#scopes repo
语言:English (United States) Chrome扩展程序可在VMware Horizon Agent中启用浏览器选项卡重定向。 Chrome扩展程序可在VMware Horizon Agent中启用浏览器重定向。 VMware Horizon浏览器重定向扩展允许...
WFP流量重定向驱动程序WFP流量重定向驱动程序用于基于Windows筛选平台(WFP)重定向网络层和成帧层上的NIC流量。 该项目是从派生的。特征灵活且可配置反流量嗅探(WinPcap / Npcap / Rawsock嗅探)如何建立/部署要求...
Remove-Google-Redirection, 在Google搜索结果中,删除重定向并单击跟踪 简介禁止点击跟踪,并在Google搜索页中点击结果链接时阻止url重定向。脚本主页:英语或者中文版。浏览器支持苹果 Safari从Github下载:删除...
An Efficient I/O-Redirection-Based Reconstruction Scheme for Erasure-Coded Storage Clusters
clinify-redirection-2
10 MPoly/sec – Byte-Addressable (8-/16-/32-/64-Bit Data) · Universal Scalable Shader Engine: – 8-Bit Overflow Protection Multi-threaded Engine Incorporating – Bit-Field Extract, Set, Clear Pixel ...
语言:English (United States) Chrome扩展程序可在VMware Horizon Agent中启用HTML5多媒体重定向。 ... ... 此扩展名应安装在Horizon桌面/应用程序中。 请与您的IT部门联系以获得进一步的帮助。...
Node Monzo API易于集成 安装方式 npm i monzo-api -S 用法 import MonzoApi from 'monzo-api'; const clientId = 'your-app-client-id'; const clientSecret = 'your-app-client-secret'; const verificationCode ...
基于https://brennan.io/2015/01/16/write-a-shell-in-c/修改的shell,增加了multiple pipes以及redirection的支持。
Changes in 2.4.6 (February 22, 2011): Brief summary : - Support more host OS to run on: - Include win64 native binary in the release. - Fixed failures on big endian hosts. - BIOS: Support for up to...
[ -5] Initial redirection from http to https is to a different host, preventing HSTS [ -5] Subresource Integrity (SRI) not implemented, but all external scripts are loaded over https [ -5] X-...
在解压后的根目录中编辑eclipse-inst.ini ,并在最后添加以下行: -Doomph.redirection.setups=index:/->https://raw.githubusercontent.com/FlasH-RUS/oomph/master/setups/ 正在安装 安装程序打开后,切换到高级...
为了保证客户端安全,xmlhttp是无法跨域获取信息的。但是IE出现安全问题,在服务端通过mhtml重定向漏洞,可以利用xmlhttp跨域获取敏感信息。本文介绍了通过xmlhttp请求本域的页面。
Android API Require API 1 Versions 1.0.0 release Multi-thread http download 1.2.1 release Bugfix:download thread dispath Support url redirection DLManager will download with single thread if server...
tags = require ( 'thoughtpad-plugin-redirection' ) ; yield thoughtpad . notify ( "html-postcompile-all-request" ) ; 如果在配置中找到其他语言,插件将发出html-compile-all-request 。 配置文件设置 ...
2016-11-09(不点) 0x8205 bit 5 = 1: 使checkkey闲置循环停止指令。 2016-04-13(yaya) 支持动画菜单 setmenu --graphic-entry=类型=菜单行数=菜单列数=图形宽(像素)=图形高(像素)=菜单行间距(像素) 菜单项0...