當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。