2 qq 16980459 qq_16980459 于 2016.04.09 18:35 提问

android新手有段代码没看懂,help me please!小米便签的源码
@Override
protected void onCreateContextMenu(ContextMenu menu) {
    if (getText() instanceof Spanned) {
        int selStart = getSelectionStart();
        int selEnd = getSelectionEnd();

        int min = Math.min(selStart, selEnd);
        int max = Math.max(selStart, selEnd);

        final URLSpan[] urls = ((Spanned) getText()).getSpans(min, max, URLSpan.class);
        if (urls.length == 1) {
            int defaultResId = 0;
            for(String schema: sSchemaActionResMap.keySet()) {
                if(urls[0].getURL().indexOf(schema) >= 0) {
                    defaultResId = sSchemaActionResMap.get(schema);
                    break;
                }
            }

            if (defaultResId == 0) {
                defaultResId = R.string.note_link_other;
            }

            menu.add(0, 0, 0, defaultResId).setOnMenuItemClickListener(
                    new OnMenuItemClickListener() {
                        public boolean onMenuItemClick(MenuItem item) {
                            // goto a new intent
                            urls[0].onClick(NoteEditText.this);
                            return true;
                        }
                    });
        }
    }
    super.onCreateContextMenu(menu);
}
Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!
其他相关推荐
please help me
SELECT OPERATION_SEQ_NUM,<br>STANDARD_OPERATION_CODE,<br>REFERENCE_FLAG,<br>DEPARTMENT_CODE,<br>EFFECTIVITY_DATE,DISABLE_DATE,<br>OPTION_DEPENDENT_FLAG,<br>OPERATION_LEAD_TIME_PERCENT,<br>PROCESS_SEQ_NUM,<br>PROCESS_CODE,<br>LINE_OP_SEQ_NUM,<br>LINE_OP_CODE,<br>YIELD,<br>CUMULATIVE_YIELD,<br>REVERSE_CUMULATIVE_YIELD,<br>INCLUDE_IN_ROLLUP,<br>OPERATION_YIELD_ENABLED,<br>NET_PLANNING_PERCENT,<br>COUNT_POINT_FLAG,<br>AUTOCHARGE_FLAG,<br>BACKFLUSH_FLAG,<br>MINIMUM_TRANSFER_QUANTITY,<br>SHUTDOWN_TYPE_VALUE,<br>SHUTDOWN_TYPE,<br>IMPL_CB,<br>CHANGE_NOTICE,<br>OPERATION_DESCRIPTION,<br>LONG_DESCRIPTION,<br>LABOR_TIME_CALC,<br>MACHINE_TIME_CALC,<br>TOTAL_TIME_CALC,<br>LABOR_TIME_USER,<br>MACHINE_TIME_USER,<br>TOTAL_TIME_USER,<br>ROW_ID,<br>OPERATION_SEQUENCE_ID,<br>ROUTING_SEQUENCE_ID,<br>STANDARD_OPERATION_ID,<br>DEPARTMENT_ID,<br>LOCATION_ID,<br>PROCESS_OP_SEQ_ID,<br>LINE_OP_SEQ_ID,<br>COUNT_POINT_TYPE,<br>CREATION_DATE,<br>LAST_UPDATE_DATE,<br>PROGRAM_UPDATE_DATE,<br>IMPLEMENTATION_DATE,<br>LAST_UPDATED_BY,<br>CREATED_BY,<br>LAST_UPDATE_LOGIN,<br>REQUEST_ID,<br>PROGRAM_APPLICATION_ID,<br>PROGRAM_ID,<br>ATTRIBUTE_CATEGORY,<br>ATTRIBUTE1,ATTRIBUTE2,ATTRIBUTE3,ATTRIBUTE4,ATTRIBUTE5,ATTRIBUTE6,ATTRIBUTE7,ATTRIBUTE8,ATTRIBUTE9,ATTRIBUTE10,ATTRIBUTE11,ATTRIBUTE12,ATTRIBUTE13,ATTRIBUTE14,ATTRIBUTE15,<br>OPERATION_TYPE <br>FROM BOM_OPERATION_SEQUENCES_V <br>WHERE (<br> (2 IN (2,3) and NVL(operation_type, 1) =1 ) OR(2 = 1 and operation_type = DECODE(1, 4, 1, 1))<br> ) <br>AND (<br> ('' = 2 AND process_op_seq_id = '')OR ('' = 3 and line_op_seq_id = '') OR ('' is null)<br> ) <br>and (<br> 1 = 1 or (1 = 2 and (effectivity_date <= to_date('28-08-2007 11:39:33','DD-MM-YYYY HH24:MI:SS') and nvl(disable_date, to_date('28-08-2007 11:39:33','DD-MM-YYYY HH24:MI:SS') + 1) >= to_date('28-08-2007 11:39:33','DD-MM-YYYY HH24:MI:SS'))) or (1 = 3 and (nvl(disable_date, to_date('28-08-2007 11:39:33','DD-MM-YYYY HH24:MI:SS') + 1) >= to_date('28-08-2007 11:39:33','DD-MM-YYYY HH24:MI:SS')))<br> ) <br>AND (<br> (('' = 1 and implementation_date is not null) or ('' = 2 and implementation_date is null) or '' is null ) AND ((1 = 1 and implementation_date is not null) or 1 = 2) <br> ) <br>and (ROUTING_SEQUENCE_ID=22274)<br>order by OPERATION_SEQ_NUM<br>
android小米便签源码
android小米便签源码
动态规划中的方格问题 Please help me!!
在一个n×m的方格中,m为奇数,放置有n×m个数,如图7: 1
Android便签源码
非常有利于于学习Android知识,里面不仅包含有一些常用代码和框架,还有数据库基本的增删改查,希望大家能够共同进步。
help me
推荐个jsp入门视频
HELP ME
      我是一个初学ASP.NET的电脑爱好者,有太多的“?????”不知有哪一位大侠愿意为这个“BB”引路。我无以回报,只有努力学习来报答您的大恩。我的emil:lixufengdage@tom.com QQ:109916128
help me!!!
用MFC做把一幅完整的图形打乱,通过移动调换各部分小图块与一个空档的位置,最终恢复图片原貌。要求:(1)图片可分成4(2×2)、9(3×3)和16(4×4)片,通过工具按钮实现,(2)在视窗左边显示完整图片,在右边显示分割并打乱的图片,打乱的图片中有一空档位置,初始时位于最右下角。点击与空档位置相邻的图块可以与其互调位置。若点击不与空档相邻的图块,程序不做任何反映。借助空档位置,可以将打乱的图
help me
在vb里面能做access附图这样的表单吗?大虾们帮我弄弄看有没有电子邮件sam.cheng@synfort.com 
小米便签源码
micode looks better in dark than ever with all the improvements that have been made this year. All platforms have seen improvements, and among others, table headers
Android:仿小米便签,图文混排
经过两天的摸索,终于实现,现在贴出来,供自己学习记录及与小伙伴们交流分享先看下效果图:(添加按钮,用于添加图片)话不多说,小翠上代码:1.布局文件:&amp;lt;RelativeLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot; xmlns:tools=&quot;http://schemas.android.com/tool...