Dump Bundle - Android Android OS

Android examples for Android OS:Bundle

Description

Dump Bundle

Demo Code


//package com.java2s;

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

public class Main {
    public static void debugExtra(Bundle extras) {
        if (extras != null) {
            Log.i("Log", "printing all extras information");
            java.util.Set<String> keys = extras.keySet();
            java.util.Iterator<String> keyIterator = keys.iterator();
            int index = 0;
            while (keyIterator.hasNext()) {
                Log.i("log",
                        "  extras #" + (++index) + ": "
                                + keyIterator.next());
            }/*  ww  w. j  ava  2 s .  com*/
        } else {
            Log.i("Log", "empty extras");
        }
    }
}

Related Tutorials