| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package android.nfc; |
| 18 |
|
| 19 |
import android.os.Parcel; |
| 20 |
import android.os.Parcelable; |
| 21 |
|
| 22 |
|
| 23 |
public class TechListParcel implements Parcelable { |
| 24 |
|
| 25 |
private String[][] mTechLists; |
| 26 |
|
| 27 |
public TechListParcel(String[]... strings) { |
| 28 |
mTechLists = strings; |
| 29 |
} |
| 30 |
|
| 31 |
public String[][] getTechLists() { |
| 32 |
return mTechLists; |
| 33 |
} |
| 34 |
|
| 35 |
@Override |
| 36 |
public int describeContents() { |
| 37 |
return 0; |
| 38 |
} |
| 39 |
|
| 40 |
@Override |
| 41 |
public void writeToParcel(Parcel dest, int flags) { |
| 42 |
int count = mTechLists.length; |
| 43 |
dest.writeInt(count); |
| 44 |
for (int i = 0; i < count; i++) { |
| 45 |
String[] techList = mTechLists[i]; |
| 46 |
dest.writeStringArray(techList); |
| 47 |
} |
| 48 |
} |
| 49 |
|
| 50 |
public static final @android.annotation.NonNull Creator<TechListParcel> CREATOR = new Creator<TechListParcel>() { |
| 51 |
@Override |
| 52 |
public TechListParcel createFromParcel(Parcel source) { |
| 53 |
int count = source.readInt(); |
| 54 |
String[][] techLists = new String[count][]; |
| 55 |
for (int i = 0; i < count; i++) { |
| 56 |
techLists[i] = source.createStringArray(); |
| 57 |
} |
| 58 |
return new TechListParcel(techLists); |
| 59 |
} |
| 60 |
|
| 61 |
@Override |
| 62 |
public TechListParcel[] newArray(int size) { |
| 63 |
return new TechListParcel[size]; |
| 64 |
} |
| 65 |
}; |
| 66 |
} |