Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.os.Bundle;
import android.util.Log;

public class Main {
    public static final String TAG = "HELPERS";

    public static void LogBundleExtras(Bundle bundle) {
        for (String key : bundle.keySet()) {
            Object value = bundle.get(key);

            StringBuilder builder = new StringBuilder();
            builder.append("key: ");
            builder.append(key);
            builder.append("\t\t\t\t");

            if (value != null) {

                builder.append("key: ");
                builder.append(key);
                builder.append("\t\t\t\t");

                if (value instanceof CharSequence[]) {
                    builder.append("\n====== Charsequense[]======\n");

                    for (CharSequence seq : bundle.getCharSequenceArray(key)) {
                        builder.append("value(charseq): ");
                        builder.append(seq);
                        builder.append("\n");
                    }
                    builder.append("====== \"Charsequense[]======\n");
                } else {
                    builder.append("value: ");
                    builder.append(value);
                    builder.append("\t");
                }

                builder.append("value class: ");
                builder.append(value.getClass().getName());
            } else

                builder.append("value: null");

            Log.d(TAG, builder.toString());
        }
    }
}