zoukankan      html  css  js  c++  java
  • Android四大组件

    Activity:

          onCreat() onStart() onRestart() onResume() onPause() onStop() onDestory()

          四个基本状态:活动中 暂停 停止 待用

        standard模式 创建新的activity

        singleTop模式 调用顶部activity时不创建新的

          singleTask模式一个activity实例只存在一个

          singleInstance模式新建Task

           恢复activity onSaveInstanceState() onCreat(){ savedInstanceState.get()}

        Intent:

          action data category type component extras flag

          显示Intent setComponent() setClass()

           隐式Intent InterFilter

        BroadcastReceeiver:

          继承BroadcastReceiver 实现onReceiver() 函数

      静态注册AndroidManifest.xml 动态注册 onCreat() 或onStart()中注册 onStop() 或onDestory()中撤销

      普通广播 有序广播(intent-filter 中priority)

    Service:

      onCreate() onStartCommand() onBind( return null ) onDestroy()

           startService()->onCreate()->onStartCommand()->running-> onDestroy()

           启动形式的service 继承Service(主线程中执行)继承IntentService(创建新的线程串行执行) 只需实现onHandleIntent() 方法

           bindService()->onCreate()->onBind( return IBinder )-> binded-> onUnbind()->onDestroy()

           绑定形式的service继承Service 创建一个inner class继承Binder 创建getService(return outerService.this)方法

           ServiceConnection类:onServiceConnected(),onServiceDisconnected()

        ContentPrivoder:

          onCreate() query() update() getType() delete() insert() Uri.parse(String)

          getContentResolver() android:authorities

  • 相关阅读:
    取指定长度的字符串(包括中英文),以"..."的方式显示
    js 常用函数
    js 规范
    js高级编程笔记2
    js高级编程笔记
    WinJS开发div中元素的水平和垂直居中metro
    WinJS开发iframe中Javascript执行错误metro
    MySql乱码
    正则表达式符号系统
    Java替换字符串中的回车换行
  • 原文地址:https://www.cnblogs.com/3013218061shang/p/5451565.html
Copyright © 2011-2022 走看看