本文整理匯總了Java中android.os.Bundle.toString方法的典型用法代碼示例。如果您正苦於以下問題:Java Bundle.toString方法的具體用法?Java Bundle.toString怎麽用?Java Bundle.toString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.os.Bundle
的用法示例。
在下文中一共展示了Bundle.toString方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: toString
import android.os.Bundle; //導入方法依賴的package包/類
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();
}
示例2: toString
import android.os.Bundle; //導入方法依賴的package包/類
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();
}
示例3: toString
import android.os.Bundle; //導入方法依賴的package包/類
public static String toString(Bundle b) {
if (b == null) {
return "";
}
Bundle bundle = new Bundle();
bundle.putAll(b);
return bundle.toString();
}
示例4: SafetyNetUtils
import android.os.Bundle; //導入方法依賴的package包/類
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();
}