Java Code Examples for android.os.Bundle.toString()

The following are Jave code examples for showing how to use toString() of the android.os.Bundle class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: VirtualHook   File: VLog.java   View Source Code Vote up 6 votes
public static String toString(Bundle bundle){
	if(bundle==null)return null;
	if(Reflect.on(bundle).get("mParcelledData")!=null){
		Set<String> keys=bundle.keySet();
		StringBuilder stringBuilder=new StringBuilder("Bundle[");
		if(keys!=null) {
			for (String key : keys) {
				stringBuilder.append(key);
				stringBuilder.append("=");
				stringBuilder.append(bundle.get(key));
				stringBuilder.append(",");
			}
		}
		stringBuilder.append("]");
		return stringBuilder.toString();
	}
	return bundle.toString();
}
 
Example 2
Project: TPlayer   File: VLog.java   View Source Code Vote up 6 votes
public static String toString(Bundle bundle){
	if(bundle==null)return null;
	if(Reflect.on(bundle).get("mParcelledData")!=null){
		Set<String> keys=bundle.keySet();
		StringBuilder stringBuilder=new StringBuilder("Bundle[");
		if(keys!=null) {
			for (String key : keys) {
				stringBuilder.append(key);
				stringBuilder.append("=");
				stringBuilder.append(bundle.get(key));
				stringBuilder.append(",");
			}
		}
		stringBuilder.append("]");
		return stringBuilder.toString();
	}
	return bundle.toString();
}
 
Example 3
Project: container   File: VLog.java   View Source Code Vote up 6 votes
public static String toString(Bundle bundle) {
	if (bundle == null) return null;
	if (Reflect.on(bundle).get("mParcelledData") != null) {
		Set<String> keys = bundle.keySet();
		StringBuilder stringBuilder = new StringBuilder("Bundle[");
		if (keys != null) {
			for (String key : keys) {
				stringBuilder.append(key);
				stringBuilder.append("=");
				stringBuilder.append(bundle.get(key));
				stringBuilder.append(",");
			}
		}
		stringBuilder.append("]");
		return stringBuilder.toString();
	}
	return bundle.toString();
}
 
Example 4
Project: letv   File: KVUtils.java   View Source Code Vote up 5 votes
public static String toString(Bundle b) {
    if (b == null) {
        return "";
    }
    Bundle bundle = new Bundle();
    bundle.putAll(b);
    return bundle.toString();
}
 
Example 5
Project: SecuritySample   File: SafetyNetUtils.java   View Source Code Vote up 5 votes
public SafetyNetUtils(Context ctx, Callback callback) {
    this.ctx = ctx;
    this.callback = callback;

    GoogleApiClient.OnConnectionFailedListener googleApiConnectionFailedListener = connectionResult -> Log.e(TAG, "onConnectionFailed:" + connectionResult.toString());
    GoogleApiClient.ConnectionCallbacks googleApiConnectionCallbacks = new GoogleApiClient.ConnectionCallbacks() {
        @Override
        public void onConnected(@Nullable Bundle bundle) {
            String logs = bundle == null ? "" : bundle.toString();
            callback.onResponse("GoogleApiClient onConnected " + logs);
        }

        @Override
        public void onConnectionSuspended(int i) {
            Log.d(TAG, "onConnectionSuspended" + i);
        }
    };


    Handler handler = new Handler(MyApplication.INSTANCE.safetyNetLooper.getLooper());
    googleApiClient = new GoogleApiClient.Builder(ctx)
            .addApi(SafetyNet.API)
            .addConnectionCallbacks(googleApiConnectionCallbacks)
            .addOnConnectionFailedListener(googleApiConnectionFailedListener)
            .setHandler(handler) //Run on a new thread
            .build();
    googleApiClient.connect();
    secureRandom = new SecureRandom();
}