Skip to content

Instantly share code, notes, and snippets.

@bitristan
Created September 6, 2015 11:53
Show Gist options
  • Save bitristan/1a318ba08cab05013d33 to your computer and use it in GitHub Desktop.
Save bitristan/1a318ba08cab05013d33 to your computer and use it in GitHub Desktop.
android aidl enum parameter
public enum RecognitionTaskType implements Parcelable {
HOTWORD,
OFFLINE,
ONLINE,
MIX,
RECORD_ONLY;
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(name());
}
public static final Creator<RecognitionTaskType> CREATOR = new Creator<RecognitionTaskType>() {
@Override
public RecognitionTaskType createFromParcel(final Parcel source) {
return RecognitionTaskType.valueOf(source.readString());
}
@Override
public RecognitionTaskType[] newArray(final int size) {
return new RecognitionTaskType[size];
}
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment