当前位置: 首页>>代码示例>>Java>>正文


Java Bundle.getCharSequenceArray方法代码示例

本文整理汇总了Java中android.os.Bundle.getCharSequenceArray方法的典型用法代码示例。如果您正苦于以下问题:Java Bundle.getCharSequenceArray方法的具体用法?Java Bundle.getCharSequenceArray怎么用?Java Bundle.getCharSequenceArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.os.Bundle的用法示例。


在下文中一共展示了Bundle.getCharSequenceArray方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: parseInboxNotification

import android.os.Bundle; //导入方法依赖的package包/类
@SuppressWarnings("ConstantConditions")
@TargetApi(value = Build.VERSION_CODES.JELLY_BEAN)
public boolean parseInboxNotification(Bundle extras)
{
    if (extras.containsKey(Notification.EXTRA_SUMMARY_TEXT))
        title = formatCharSequence(extras.getCharSequence(NotificationCompat.EXTRA_SUMMARY_TEXT));
    else if (extras.containsKey(Notification.EXTRA_SUB_TEXT))
        title = formatCharSequence(extras.getCharSequence(NotificationCompat.EXTRA_SUB_TEXT));
    else if (extras.containsKey(Notification.EXTRA_TITLE))
        title = formatCharSequence(extras.getCharSequence(NotificationCompat.EXTRA_TITLE));
    else
        return false;

    CharSequence[] lines = extras.getCharSequenceArray(NotificationCompat.EXTRA_TEXT_LINES);

    int i = 0;
    while (true)
    {
        text += formatCharSequence(lines[i]) + "\n\n";

            i++;
            if (i >= lines.length)
                break;
    }

    text = text.trim();

    return true;
}
 
开发者ID:matejdro,项目名称:WearVibrationCenter,代码行数:30,代码来源:NotificationTextParser.java

示例2: getCharSequenceArray

import android.os.Bundle; //导入方法依赖的package包/类
public CharSequence[] getCharSequenceArray(Bundle state, String key) {
    return state.getCharSequenceArray(key + baseKey);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:4,代码来源:Injector.java

示例3: getCharSequenceArray

import android.os.Bundle; //导入方法依赖的package包/类
public CharSequence[] getCharSequenceArray(Bundle state, String key) {
    return state.getCharSequenceArray(key + mBaseKey);
}
 
开发者ID:evernote,项目名称:android-state,代码行数:4,代码来源:InjectionHelper.java

示例4: containsKey

import android.os.Bundle; //导入方法依赖的package包/类
@SuppressWarnings("ConstantConditions") //Android Studio does not correlate between containsKey() and get() and thus throws warnings
   @TargetApi(value = Build.VERSION_CODES.JELLY_BEAN)
public boolean tryParseNatively(Notification notification)
{
	Bundle extras = NotificationCompat.getExtras(notification);
	if (extras == null)
		return false;

       if (parseMessageStyleNotification(notification, extras))
           return true;

       if (extras.containsKey(Notification.EXTRA_TEXT_LINES) && extras.getCharSequenceArray(Notification.EXTRA_TEXT_LINES).length > 0)
       {
           if (parseInboxNotification(extras))
               return true;
       }

	if (!extras.containsKey(Notification.EXTRA_TEXT) && !extras.containsKey(Notification.EXTRA_TEXT_LINES) && !extras.containsKey(Notification.EXTRA_BIG_TEXT))
	{
		return false;
	}
	
	if (extras.containsKey(Notification.EXTRA_TITLE_BIG))
	{
		CharSequence bigTitle = extras.getCharSequence(NotificationCompat.EXTRA_TITLE_BIG);
           if (bigTitle != null && (bigTitle.length() < 40 || !extras.containsKey(Notification.EXTRA_TITLE)))
			title = bigTitle.toString();
		else
			title = formatCharSequence(extras.getCharSequence(NotificationCompat.EXTRA_TITLE));
	}
	else if (extras.containsKey(NotificationCompat.EXTRA_TITLE))
           title = formatCharSequence(extras.getCharSequence(NotificationCompat.EXTRA_TITLE));

       if (extras.containsKey(Notification.EXTRA_TEXT_LINES))
       {
           for (CharSequence line : extras.getCharSequenceArray(NotificationCompat.EXTRA_TEXT_LINES))
           {
               text += formatCharSequence(line) + "\n\n";
           }
           text = text.trim();
       }
       else if (extras.containsKey(Notification.EXTRA_BIG_TEXT))
       {
           text = formatCharSequence(extras.getCharSequence(NotificationCompat.EXTRA_BIG_TEXT));
       }
       else
       {
           text = formatCharSequence(extras.getCharSequence(NotificationCompat.EXTRA_TEXT));
       }

       if (extras.containsKey(Notification.EXTRA_SUB_TEXT))
       {
           text = text.trim();
           text= text + "\n\n" + formatCharSequence(extras.getCharSequence(NotificationCompat.EXTRA_SUB_TEXT));
       }


       return true;
}
 
开发者ID:matejdro,项目名称:WearVibrationCenter,代码行数:60,代码来源:NotificationTextParser.java

示例5: handleMessage

import android.os.Bundle; //导入方法依赖的package包/类
@Override
public void handleMessage(Message msg) {
    switch (msg.what) {
        case MSG_AGENT_START:
            //agentStart();
        break;
        case MSG_AGENT_SERVICE_BOUND:
            // Log.i(TAG + ":MSG_AGENT_SERVICE_BOUND", "sendPrepareUploadFiles()");
            sendPrepareUploadFiles(uploadFiles);
        break;
        case MSG_AGENT_START_WRITE:
            Log.i(TAG, "handleMessage: MSG_AGENT_START_WRITE");
            if (msg.obj != null){
                if (msg.obj instanceof ParcelFileDescriptor){
                  if (uploadFiles != null) {
                    if (uploadFiles.size() > 0) {
                      if (msg.getData() != null) {
                        ExplorCurrentUploadData(msg.getData());
                        WriteFileDescriptor wFD = new WriteFileDescriptor();
                        writeFilesHM.put(currentUploadFile, (ParcelFileDescriptor)msg.obj);
                        //wFD.writeFileDescriptor = (ParcelFileDescriptor)msg.obj;
                        wFD.writeFileDescriptor = writeFilesHM.get(currentUploadFile);
                        new Thread(wFD).start();
                        deliverMessage(mService, UploadAgent.MSG_SERVICE_START_READ, null);
                      }
                    }
                  }
                } else {
                    //Toast.makeText(getApplicationContext(), "UploadAgent:no Descriptor!", Toast.LENGTH_SHORT).show();
                }
            }
            break;
        case MSG_AGENT_COMPLETE_WRITE:
            //Toast.makeText(getApplicationContext(), "UploadAgent: Delete File!: " + isDeleteAftUpload, Toast.LENGTH_SHORT).show();
            Bundle data = msg.getData();
            if (data.containsKey(COMPLETE_READ_FILES)) {
                CharSequence[] filesArr = data.getCharSequenceArray(COMPLETE_READ_FILES);
                onCompleteWrite(filesArr);
            } else {
                onCompleteWrite(null);
            }
            break;
        case MSG_AGENT_SERVICE_OFF:
            Log.i(TAG, "handleMessage: MSG_AGENT_SERVICE_OFF");
            isAbandon = true;
            onAgentServiceOff();
        break;
        default:
            super.handleMessage(msg);
    }
}
 
开发者ID:quanzhuo,项目名称:prada,代码行数:52,代码来源:UploadAgent.java


注:本文中的android.os.Bundle.getCharSequenceArray方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。