本文整理汇总了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;
}
示例2: getCharSequenceArray
import android.os.Bundle; //导入方法依赖的package包/类
public CharSequence[] getCharSequenceArray(Bundle state, String key) {
return state.getCharSequenceArray(key + baseKey);
}
示例3: getCharSequenceArray
import android.os.Bundle; //导入方法依赖的package包/类
public CharSequence[] getCharSequenceArray(Bundle state, String key) {
return state.getCharSequenceArray(key + mBaseKey);
}
示例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;
}
示例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);
}
}