intent和手势探测
一、三种启动方法
setComponent
- ComponentName comp = new ComponentName(
- this, SecondActivity.class);
- Intent intent = new Intent();
- intent.setComponent(comp);
- startActivity(intent);
setClass
- public Intent setClass(
- Context packageContext, Class<?> cls)
- Intent intent = new Intent();
- intent.setClass(this, SecondActivity.class);
- startActivity(intent);
intent构造方法
- Intent intent = new Intent(this, SecondActivity.class);
startActivity(intent);
二、数据传递
- public Intent putExtras(Bundle extras)
- public Bundle getExtras()
数据返回
- public void startActivityForResult(
- Intent intent, int requestCode);
- public final void setResult(
- int resultCode, Intent data);
- protected void onActivityResult(
- int requestCode, int resultCode, Intent data)
三、手势探测
- public GestureDetector(Context context, GestureDetector.OnGestureListener listener)
重写
- public boolean onTouchEvent(MotionEvent event) {
return gd.onTouchEvent(event);
}
四、隐式启动
1、
启动浏览器
- Intent intent = new Intent();
intent.setAction(Intent.ACTION_MAIN);- intent.addCategory(
- Intent.CATEGORY_APP_BROWSER);
startActivity(intent);
2、同时设置Action和DATA属性
- public Intent setData(Uri data);
- public static Uri parse(String uriString)
intent和手势探测的更多相关文章
- 手势识别(一)--手势基本概念和ChaLearn Gesture Challenge
以下转自: http://blog.csdn.net/qq1175421841/article/details/50312565 像点击(clicks)是GUI平台的核心,轻点(taps)是触摸平台的 ...
- android 资讯阅读器(二)
接着上次的博客,上次移植完了tab以后整个app的框架就算是定下来了. 本次目标: 1.数据的获取与展示(ListView) 2.官方的下拉刷新效果(SwipeRefreshLayout) 3.数据接 ...
- 模仿ViewPager控件
自定义控件是开发中经常使用的技术.系统中自带的ViewPager实现的功能有时候不能满足开发的需要,如ViewPager没有滑动图片时的动画切换效果.通过对 ViewPager的模仿和部分功能的加强, ...
- Android三种左右滑动效果 手势识别
Android三种左右滑动效果 手势识别(转) 手势识别 1.onCreate中添加GestureDetector mGestureDetector; //监听手势事件 mGestureDetec ...
- Kinect 开发 —— 手势识别(上)
像点击(clicks)是GUI平台的核心,轻点(taps)是触摸平台的核心那样,手势(gestures)是Kinect应用程序的核心 关于手势的定义的中心在于手势能够用来交流,手势的意义在于讲述而不是 ...
- 自己动手打造基于 WKWebView 的混合开发框架(一)WKWebView 上手
http://www.cocoachina.com/ios/20150911/13301.html 代码示例:https://github.com/johnlui/Swift-On-iOS/tree/ ...
- 手势抽取过程&代码复用
public abstract class BaseSetupActivity extends Activity { private GestureDetector gestureDetector; ...
- android131 360 05 手势触摸滑动,sim卡,开机启动的广播,手机联系人,SharedPreferences,拦截短信
安卓手势触摸滑动: package com.itheima52.mobilesafe.activity; import android.app.Activity; import android.con ...
- Android手势操作
xml文件 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:to ...
随机推荐
- Taro开发之城市选择器(带坐标)
要写个城市选择器能返回对应的城市(这里只定义到了地级市),同时返回坐标系,参考了网上资料,下面就看看具体代码吧 import Taro, { Component } from '@tarojs/tar ...
- ApplicationListener接口的生命周期
create:游戏初次创建时被调用,一般在这里创建ApplicationListener对象,初始化布景信息,将数据或UI布局绑定到监听器等,执行完该方法后会执行resize方法,是游戏创建立即执行的 ...
- C#移动及改变控件大小
//代码比较简单,就不多解析了. #region 移动窗体保存数据 Point mouseOff;//鼠标移动位置变量 bool leftFlag; //标志是否为左键 bool largeFlag; ...
- linux学习笔记:关于环境变量
(摘自https://blog.csdn.net/llzk_/article/details/53813266之后整合) 1.linux系统的条件 Linux是一个多用户的操作系统,每个用户登录系统时 ...
- forEach() 和 map() 遍历
1.forEach() 没有返回值. arr[].forEach(function(value,index,array){ //do something }) 参数:value数组中的当前项, i ...
- 【Spring学习】Spring的源码解析之路
缘起:=====>>>> 在项目中实际上是用到了Spring的内容,只是直接用的SpringBoot,不管是Eclipse中还是在Intellig IDEA中,应该都比较容易能 ...
- TZOJ 2289 Help Bob(状压DP)
描述 Bob loves Pizza but is always out of money. One day he reads in the newspapers that his favorite ...
- 项目总结20:阿里云免费https证书申请
项目总结20:阿里云免费https证书申请 1. 登录阿里云控制台 www.aliyun.com,用账户信息登录 2. 在”产品与服务”搜索SSL,选择SSL证书 3. 点击购买证书 4. 选择” S ...
- 复制粘贴插件(不包含 Flash)——clipboard.js
clipboard.js是现代化的“复制到剪切板”插件.不包含 Flash.gzip 压缩后仅 3kb.不依赖 Flash 或其他臃肿的框架.API:https://clipboardjs.com c ...
- C# 小数点后保留两位小数,四舍五入的函数及使用方法
1 Math.Round(45.367,2) //Returns 45.37 2 Math.Round(45.365,2) //Returns 45.36 C#中的Round()不是我们中国人理解的四 ...