android+notepad教程,Android Sample学习——NotePad

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

1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 、4下载使用后,可先查看README.md或论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码。 1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合;、下载 4使用后,可先查看README.md或论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码。 1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合;、 4下载使用后,可先查看README.md或论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值