【Android学习记录 - Intent】教程文章相关的互联网学习教程文章

Android学习(二十三)SubMenu 子菜单【代码】

一、SubMenu子菜单  和功能菜单相似,但是可以添加子菜单。 二、实现步骤:  1、通过onCreateOptionsMenu方法创建子菜单,可以通过代码动态创建,也可以通过xml进行创建。  2、通过onOptionsItemSelected方法实现点击子菜单的事件。 三、参考代码:  1、通过代码动态创建子菜单:  main.javapackage com.example.zhengcheng.submenudemo;import android.support.v7.app.ActionBarActivity; import android.os.Bundle; i...

Android学习笔记-SQLite的使用【图】

Android学习笔记-SQLite的使用界面文件activity_main.xml<div id="highlighter_758076" xml"="" style="width: 720px; margin: 0.3em 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border-bottom-right-radius: 0px !important; border-bottom-left-radius: 0px !important; border: 0px !important; bottom: auto !important; float: none !important; left: auto !impor...

Android学习笔记(四十):Preference的使用

Preference直译为偏好,博友建议翻译为首选项。一些配置数据,一些我们上次点击选择的内容,我们希望在下次应用调起的时候依旧有效,无须用户再一次进行配置或选择。Android提供preference这个键值对的方式来处理这样的情况,自己主动保存这些数据,并立时生效,同一时候Android提供一种类似的layout的方式来进行Prefernce的布局。一个简单的Preferenece样例步骤1:编写preference XML,在res/xml/下增加我们的preference XML文件,...

Android学习记录 - Intent

1,Intent是什么? Intent是Activity之间跳转的媒介,通过这个媒介,一个Activity可以跳转到另一个Activity2,为什么需要Intent(意义、作用等) 当应用程序具有多个Activity时,通常需要从一个Activity跳转到另一个Activity,而Intent的作用就是完成这个跳转,并且它还可以协助一个Activity传递数据给另一个Activity 一个Activity类似于一个网页,网页之间的跳转使用URL,而Activity之间的跳转使用Intent原文:http://ww...

Android学习笔记【图】

android开发中的四大组件:ActivityServiceBroadcastReceiverContentProviderActivity的生命周期:原文:http://www.cnblogs.com/liaojie970/p/5770788.html

Android学习笔记(1)【代码】

1.消除主题背景1 @Override 2protectedvoid onCreate(Bundle savedInstanceState) { 3super.onCreate(savedInstanceState); 4 setContentView(R.layout.activity_main); 5 getWindow().setBackgroundDrawable(null); 6 }2.检查当前线程是否是UI线程1/**2 * Looper类有一个名为myLooper()的静态方法,为当前线程返回Looper 3 * getMainLooper()方法为UI线程返回Looper 4*/5if(Looper.myLooper()=...

android 学习笔记 杂记1

getIntent().getExtras().get("intent"); 这个intent是数据包装的参数。 比如: Intent intent = new Intent(this, YouClass.class); intent.putExtra("data1","youdata"); startActivit(intent ); 获取数据 getIntent().getExtras().get("data1");不用实例化 就像引用的就只有类里面设为静态方法的数据和方法才行 listview中onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) ? 后面有4个参数,乍看直接晕菜,那...

【转】Pro Android学习笔记(十六):用户界面和控制(4):ImageView控件【图】

目录(?)[-]XML片段代码设置ImageViewImageView是基础的控件,它是android.widget.ImageView的继承类。XML片段 <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal"> <!-- 指定资源id: @drawable/xxxxx --> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" ...

Android 学习之 开源项目PullToRefresh的使用【图】

首先 下载 Android-PullToRefresh-master下载地址 https://github.com/chrisbanes/Android-PullToRefresh下载之后将其解压现在 我们用eclipse 创建一个项目取名PullToRefresh将上面的library 引入我们的项目引入成功之后打开项目的project.properties文件我们可以看到android.library.reference.1=../Android-PullToRefresh-master/library这样就表示可以引用成功了我们在res/layout创建 布局文件main.xml<?xml version="1.0" en...

android学习之VelocityTracker

今天大概的学习了一下VelocityTracker ,用来监控手势速度的,在View移动过程中,可以有个缓冲的移动。 我觉得初步的使用起来是很简单的。首先移动依靠的是Scroller类,Scroller中有个fling的方法,将MotionEvent的Up之后检测的手势速度提供给scroller之后,就可以自己完成滚动。1.初始化有些变量: private void init(Context context){ mScroller = new Scroller(getContext()); final ViewConfiguration configu...

Android学习路线(二十一)运用Fragment构建动态UI——创建一个Fragment【代码】

你能够把fragment看成是activity的模块化部分。它拥有自己的生命周期,接受它自己的输入事件,你能够在activity执行时加入或者删除它(有点像是一个“子activity”。你能够在不同的activity中重用它)。本课将向你展示怎样使用Support Libaray继承 Fragment 类来让你的应用能够兼容正在执行Android1.6的设备。 Demo下载:http://download.csdn.net/detail/sweetvvck/7757891 提示: 假设你决定你的应用需求的最低API级别是11或者更高...

Android学习笔记—第四章 Android开发组件2

第四章 Android开发组件2列表类组件(1)ListView组件:以垂直列表的形式列出需要显示的列表项相关属性:a. android:divider 用于为列表视图设置分隔条,可以用颜色或者图片资源b. android:dividerHeight 设置分隔条的高度c. android:entries 通过数组资源为ListView指定列表项d. android:footerDividersEnabled 设置是否在footerView之前绘制分隔条,默认为true。e. android:headerDividersEnabled 设置是否在headerView之后...

Android学习随笔之UI美化(二)--------- shape的使用【代码】【图】

shape用于设定形状,可以在selector,layout等里面使用,有6个子标签。 大小(size)渐变(gradient)填充(solid)圆角(corners)描边(stroke)间隔(padding) res/drawable/shape_self.xml<?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android"><!-- 控件内部图片的高度 --><sizeandroid:height="100dp"android:width="180dp"/><!-- gradient (渐变) --><gradientand...

Android学习笔记:超能RecyclerView组件使用总结

个人认为 RecyclerView组件确实值得学习并用到我们的项目中去,前面学了相关的内容。今天再补充一些相关的东东。1,实现对RecyclerView中的数据进行加入和删除操作。还是一样直接上代码:public class MainActivity extends ActionBarActivity {private RecyclerView mRecyclerView;private List<TestData> mDatas;private TestAdapter mAdapter;@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(sav...

android学习笔记一【图】

Android开发环境(基于eclipse)的安装:从http://www.androiddevtools.cn/可以下载各种需要的工具,最基础的是SDK Tools,包括SDK Manager.exe(可以下载或更新SDK和其他工具),AVD Manager.exe(创建Android模拟器,方便测试)。SDK(Software Development Kit)是开发Android所使用的开发包,针对不同的Android版本需要使用不同的SDK。一些问题:①SDK Manager中只有一种SDK版本。可以选择SDK离线下载,或者从http://blog.csdn.net/ultrapro/a...