2 * Copyright (C) 2006 The Android Open Source Project
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 import android.content.Intent;
20 import android.os.IBinder;
21 import android.os.Parcel;
22 import android.os.Parcelable;
23 import android.os.Bundle;
30 public class ResultInfo implements Parcelable {
31 public final String mResultWho;
32 public final int mRequestCode;
33 public final int mResultCode;
34 public final Intent mData;
36 public ResultInfo(String resultWho, int requestCode, int resultCode,
38 mResultWho = resultWho;
39 mRequestCode = requestCode;
40 mResultCode = resultCode;
44 public String toString() {
45 return "ResultInfo{who=" + mResultWho + ", request=" + mRequestCode
46 + ", result=" + mResultCode + ", data=" + mData + "}";
49 public int describeContents() {
53 public void writeToParcel(Parcel out, int flags) {
54 out.writeString(mResultWho);
55 out.writeInt(mRequestCode);
56 out.writeInt(mResultCode);
59 mData.writeToParcel(out, 0);
65 public static final Parcelable.Creator<ResultInfo> CREATOR
66 = new Parcelable.Creator<ResultInfo>() {
67 public ResultInfo createFromParcel(Parcel in) {
68 return new ResultInfo(in);
71 public ResultInfo[] newArray(int size) {
72 return new ResultInfo[size];
76 public ResultInfo(Parcel in) {
77 mResultWho = in.readString();
78 mRequestCode = in.readInt();
79 mResultCode = in.readInt();
80 if (in.readInt() != 0) {
81 mData = Intent.CREATOR.createFromParcel(in);