android.view.Menu专场

Interface for managing the items in a menu.

By default, every Activity supports an options menu of actions or options. You can add items to this menu and handle clicks on your additions. The easiest way of adding menu items is inflating an XML file into the

Different menu types support different features:

Context menus: Do not support item shortcuts and item icons.

Options menus: The icon menus do not support item check marks and only show the item's expanded menus (only available if six or more menu items are visible, reached via the 'More' item in the icon menu) do not show item icons, and item check marks are discouraged.

Sub menus: Do not support item icons, or nested sub menus.

public abstract MenuItemadd (int groupId, int itemId, int order, int titleRes)

Variation on

Parameters

groupId

The group identifier that this item should be part of. This can also be used to define groups of items for batch state changes. Normally use

itemId

Unique item ID. Use

order

The order for the item. Use

titleRes

Resource identifier of title string.

Returns

The newly added menu item.

public abstract MenuItemsetShortcut (char numericChar, char alphaChar)

Change both the numeric and alphabetic shortcut associated with this item. Note that the shortcut will be triggered when the key that generates the given character is pressed alone or along with with the alt key. Also note that case is not significant and that alphabetic shortcut characters will be displayed in lower case.

See

Parameters

numericChar

The numeric shortcut key. This is the shortcut when using a numeric (e.g., 12-key) keyboard.

alphaChar

The alphabetic shortcut key. This is the shortcut when using a keyboard with alphabetic keys.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

android.graphics.Rect

Rect holds four integer coordinates for a rectangle. The rectangle is represented by the coordinates of its 4 edges (left, top, right bottom). These fields can be accessed directly. Use width() and height() to retrieve the rectangle's width and height. Note: most methods do not check to see that the coordinates are sorted correctly (i.e. left <= right and top <= bottom).

android.graphics.Paint

The Paint class holds the style and color information about how to draw geometries, text and bitmaps.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

android.content.Intent专题:

Uri android.content.Intent.getData()

public UrigetData ()

Retrieve data this intent is operating on. This URI specifies the name of the data; often it uses the content: scheme, specifying data in a content provider. Other schemes may be handled by specific activities, such as http: by the web browser.

Returns

The URI of the data this intent is targeting or null.

public IntentsetData (Uri data)

Set the data this intent is operating on. This method automatically clears any type that was previously set by

Note: scheme and host name matching in the Android framework is case-sensitive, unlike the formal RFC. As a result, you should always ensure that you write your Uri with these elements using lower case letters, and normalize any Uris you receive from outside of Android to ensure the scheme and host is lower case.

Parameters

data

The URI of the data this intent is now targeting.

Returns

Returns the same Intent object, for chaining multiple calls into a single statement.

public static final StringACTION_INSERT

Activity Action: Insert an empty item into the given container.

Input:

Output: URI of the new data that was created.

Constant Value:"android.intent.action.INSERT"

public IntentsetAction (String action)

Set the general action to be performed.

Parameters

action

An action name, such as ACTION_VIEW. Application-specific actions should be prefixed with the vendor's package name.

Returns

Returns the same Intent object, for chaining multiple calls into a single statement.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~·

android.app.Activity专场:

void android.app.Activity.finish()

public voidfinish ()

Call this when your activity is done and should be closed. The ActivityResult is propagated back to whoever launched you via onActivityResult().

public final voidsetResult (int resultCode, Intent data)

Call this to set the result that your activity will return to its caller.

Parameters

resultCode

The result code to propagate back to the originating activity, often RESULT_CANCELED or RESULT_OK

data

The data to propagate back to the originating activity.

public voidsetContentView (int layoutResID)

Set the activity content from a layout resource. The resource will be inflated, adding all top-level views to the activity.

Parameters

layoutResID

Resource ID to be inflated.

public final CursormanagedQuery (Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder)

Wrapper around

Parameters

uri

The URI of the content provider to query.

projection

List of columns to return.

selection

SQL WHERE clause.

selectionArgs

The arguments to selection, if any ?s are pesent

sortOrder

SQL ORDER BY clause.

Returns

The Cursor that was returned by query().

public voidsetTitle

Change the title associated with this activity. If this is a top-level activity, the title for its window will change. If it is an embedded activity, the parent can do whatever it wants with it.

public booleanonOptionsItemSelected

This hook is called whenever an item in your options menu is selected. The default implementation simply returns false to have the normal processing happen (calling the item's Runnable or sending a message to its Handler as appropriate). You can use this method for any items for which you would like to do processing without those other facilities.

Derived classes should call through to the base class for it to perform the default menu handling.

Parameters

item

The menu item that was selected.

Returns

boolean Return false to allow normal menu processing to proceed, true to consume it here.

public IntentgetIntent ()

Return the intent that started this activity.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~·

android.widget.TextView专场:

public final voidsetTextKeepState

Like

Parameters

text

The new text to place in the text view.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

android.database.Cursor专场:

String android.database.Cursor.getString(int columnIndex)

public abstract StringgetString (int columnIndex)

Returns the value of the requested column as a String.

If the native content of that column is not text the result will be the result of passing the column value to String.valueOf(x).

Parameters

columnIndex

the zero-based index of the target column.

Returns

the value of that column as a String.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

android.content.ContentValues专题:

void android.content.ContentValues.put(String key, String value)

public voidput

Adds a value to the set.

Parameters

key

the name of the value to put

value

the data for the value to put

android+notepad教程,Android Sample学习——NotePad相关推荐

  1. Android精通教程-Android入门简介

    前言 大家好,我是 Vic,今天给大家带来Android精通教程-Android入门简介的概述,希望你们喜欢 每日一句 If life were predictable it would cease ...

  2. Android 相机教程,Android 相机教程

    Android相机教程 相机主要用于捕获图片和视频.我们可以通过使用相机API的方法来控制相机. Android通过以下两种方式提供了在相机上工作的功能: 通过相机意图 通过相机API 了解相机意图和 ...

  3. android+notepad教程,Android平台应用开发实例:Notepad

    在这个教程中将会建立一个简单列表界面,允许用户添加删除,但是不能编辑.包括如下的内容: ◆ListActivities的基础知识和如何建立菜单项. ◆如何使用SQLite 数据库访问数据. ◆如何使用 ...

  4. android fragment 教程,Android app开发中的Fragment入门学习教程

    在Android3.0上开始引入了一个新概念叫Fragment.它有自己的布局文件,可以作为组件排布,也可以相互组合去实现不同的布局显示.使用Fragment可以重复利用代码,并且可以满足不同设备尺寸 ...

  5. android广播教程,Android学习笔记(广播机制)

    1.Android的广播机制介绍 收听收音机也是一种广播,在收音机中有很多个广播电台,每个广播电台播放的内容都不相同.接受广播时广播(发送方)并不在意我们(接收方)接收到广播时如何处理.好比我们收听交 ...

  6. android打开教程,Android 打开网络上pdf文件

    1.基本思路: 打开网络pdf 思路整体还是来源与图片的加载. android中加载网络图片的框架有很多个.如image-laoder, fresco.glide等,首先都是从内存中找图片,如果内存中 ...

  7. android开发教程,android开发入门教程

    所谓知己知彼才能百战百胜,想学好android就必须先了解 android是什么意思 android环境搭建 Android一词的本义指"机器人",同时也是Google于2007年 ...

  8. sqlite数据库android使用教程,Android开发教程之 SQLite数据库的使用

    在开发Android应用程序时经常需要存储数据,Android系统提供了SQLite数据库,还提供了SQLiteOpenHelper类,使我们可以很方便的操作数据库.通过一个例子来说明在Android ...

  9. android混淆教程,Android 实现代码混淆的实例

    Android 实现代码混淆的实例 1.简介 代码混淆(Obfuscated code)亦称花指令,是将计算机程序的代码,转换成一种功能上等价,但是难于阅读和理解的形式的行为. 混淆的目的是为了加大反 ...

  10. android 动画教程,Android 动画Animation

    动画分为视图动画(view animation)和属性动画(property animation),视图动画又分为帧动画和补间动画 视图动画控件(iv)点击事件(OnClickListener接口)触 ...

最新文章

  1. 这篇文章,或许可以改善你的不快乐。
  2. 收藏 | 27个机器学习小抄(附学习资源)
  3. 定时任务scheduleAtFixedRate设定每天某个时刻执行
  4. charts漏斗图表_ECharts漏斗图属性与实例介绍
  5. gx works2 存储器空间或桌面堆栈不足_静态体验奇瑞艾瑞泽GX冠军版,细节做工很精湛...
  6. Apache Flink 为什么能够成为新一代大数据计算引擎?
  7. 【蓝桥杯单片机】红外接收及NEC红外通信协议
  8. 鸿蒙系统华为mate10,从3899跌至1040,2K分辨率+4000mAh,可升级鸿蒙系统
  9. TC SRM 665 DIV2 B LuckyCycle 暴力
  10. 怎么写linux的sh文件,linux – 什么是.sh文件?
  11. css实现w3cschool广告轮播图
  12. 机器人学导论复习笔记
  13. 菜鸟教程nginx视频_Nginx教程(一) Nginx入门教程
  14. 网关 网关路由器 网关交换机 路由器 交换机
  15. em模型补缺失值_缺失值填补方法
  16. ChatGLM-6B【完全转载】
  17. 2021年英语四级作文
  18. react-router与react-reduct配合使用时页面不刷新问题解决方法
  19. 美国服务器网站没有收录的原因分析
  20. 使用Python,提取视频文件中的音频

热门文章

  1. 社交中的黄金法则,你要细细体会品味
  2. matlab 神经网络设计多层隐含层_数据预测之BP神经网络具体应用以及matlab代码
  3. mx2 android os耗电,魅族MX3 Flyme OS 3.2充电慢、耗电快问题的解决方法详解
  4. 用于大型的科学计算的计算机,科学计算器广泛适用于大、中、小学生、教师、科研人员及其他各界...
  5. mp3 pcm java_Java mp3文件转pcm文件
  6. jquery实现二级联动不与数据库交互
  7. 您的UX库不只是书籍
  8. 按钮 交互_SwiftUI中的微交互—菜单按钮动画
  9. 杭州 3~5年 前端面经,高频面试题总结
  10. 面试官问:能否模拟实现JS的call和apply方法