`
007007jing
  • 浏览: 41392 次
  • 性别: Icon_minigender_1
  • 来自: 济南
社区版块
存档分类
最新评论
文章列表
APIDEMO里面的redirection示例本身并没有新技术,里面用到的知识点在前面的几个文章中都已涉及到:   SharedPreferences startActivityForResult redirection demo主要展示的是根据不同的条件跳转到特定的activity 里面使用到的几个关键点 1、SharedPreferences //SharedPreferences 的保存 SharedPreferences sharedPreferences = getSharedPreferences("RedirectData", 0); ...
在先前的文章 activity之间跳转传值 已经学习过这方面的内容,接下来实现这个demo就简单多了; 1、layout配置文件(一个现实结果的text 一个获取结果的按钮)   <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" ...
现在我们来学习如何使用Content Provider来访问android的contacts数据库。 1、布局配置   <?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=" ...
android保存数据有很多种方式,其中最简单的就是使用SharedPreferences。Shared Preferences存储的是key/value键值对。支持的数据类型为:boolean、long、float、int、string、stringset。SharedPreferences在保存UI的state上最为常用方便。(application之间不能使用SharedPreferences,仅限在同一个application内activity之间共享一些数据)   1、创建布局   <?xml version="1.0" encoding=" ...
学习android当然不能少了HelloWorld,接下来我们就来实现经典的Hello World 1、layout 文件   <?xml version="1.0" encoding="utf-8"?> <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_ ...
本次学习activity的跳转 1、构建intent   Intent intent = new Intent(); intent.setClass(getApplicationContext(), ForwardActivity1.class);  2、执行   startActivity(intent);  注意:默认情况下 每一个activity都会被压入stack中,按back可以弹出最顶层的activity并销毁当前activity。执行一个新的activity时如果不想把当前activity压入stack,直接调用finish();销毁当前activity   I ...
前面我们已经学习了Custom Dialog 和 Custom Title的demo。该示例相对来说就没什么新鲜的东西了,直接上代码: 1、首先在 manifest中为activity加入theme   <activity android:name=".app.activity.DialogActivity" android:label="@string/app_activity_dialog_lable" android:theme="@android:style/Theme.Dialog"> ...
android的标题栏默认是由android:lable定义的,android允许自定义标题栏,使用自定义的layou重新设置标题栏。 下面一步一步来实现自定义标题栏 1、定义标题栏layout   <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/app_activity_custom ...
android的可使用的资源文件,google建议我们在开发应用程序的时候将资源文件从代码中单独分离出来,便于后期的维护。由于现有设备的屏幕尺寸和语言设定存在变化导致我们需要根据实际情况使用layout,这就要求我们提供合适的可使用资源。 一旦我们定义了可使用的资源文件,我们就可以在代码中使用资源id调用(资源id编译后放置在R class). res资源说明如下表: 关于每个资源的详细说明请参考sdk    
apidemos里面展示的自定义窗口其实并不复杂,下面我们来看一下: 1、CustomDialogActivity和别的activity并没有区别 2、activity在项目AndroidManifest.xml配置文件中加入 android:Theme属性 例如示例:   <activity android:name=".app.activity.CustomDialogActivity" android:label="@string/app_activity_custom_dialog_lable" andr ...
1、首先学习sdk中关于Animation的说明。andorid的动画主要分为下面三种 Property Animation     版本要求: Android 3.0 (API level 11), property animation支持任何对象的动画效果,也是android推荐的模式。 可以很好的扩展。(因为本次demo版本为2.3 在这里不在研究,留在以后研究) View Animation     View Animation 只能在Views使用. 优点是实现简单.缺点也很明显:首先只支持view,其次是他只是改变view的动画效果,并没有实际改变view,例如让一个 ...
android最有价值的参考资料莫过于sdk提供的apidemos,现在我们就开始一点一点的学习,本人水平有限,文章中出现错误请您指正。 sdk中得apidemos接近200个,设计到android的各个方面,首先先学习下android的开发人员如何将这200多个demo分类的。 1、首先在AndroidManifest.xml注册activity时附件以下intent-filter 例如   <activity android:name=".app.Animation" android:label="@string/activity_animatio ...
Android之Intent探究  在一个Android应用中,主要由四种组件组成(四种组件分别为:Activity、Broadcast、Service、ContentProvider),而这四种组件是独立的,它们之间可以互相调用,协调工作,最终组成一个真正的Android应用。在这些组件之间的通讯中,主要是由Intent协助完成的。   Intent负责对应用中一次操作的动作、动作涉及数据、附加数据进行描述,Android则根据此Intent的描述,负责找到对应的组件,将Intent传递给调用的组件,并完成组件的调用。   因此,Intent在这里起着一个媒体中介的作用,专门 ...
Activity 跳转 无返回结果 Intent intent = new Intent(AndroidActivityActivity.this, MyActivity.class); startActivity(intent); Activity 跳转 返回结果不带附加数据 请求activity代码 以及响应返回代码 Intent intent = new Intent(AndroidActivityActivity.this, MyActivity.class); startActivityForResult(intent, REQUEST_TE ...
 In Android, an application can be “alive” even if its process has been killed. Put another way, the activity life cycle is not tied to the process life cycle. Processes are just disposable containers for activities. 摘自 Hello.Android.3rd.Edition
Global site tag (gtag.js) - Google Analytics