diff --git a/core/java/android/os/CountDownTimer.java b/core/java/android/os/CountDownTimer.java index c7bf0fd6ba49a..51faa855727ed 100644 --- a/core/java/android/os/CountDownTimer.java +++ b/core/java/android/os/CountDownTimer.java @@ -22,7 +22,22 @@ package android.os; * * Example of showing a 30 second countdown in a text field: * - *
+ *+ ** * The calls to {@link #onTick(long)} are synchronized to this object so that * one call to {@link #onTick(long)} won't ever occur before the previous diff --git a/core/java/android/os/Debug.java b/core/java/android/os/Debug.java index 903bea3dc2ceb..1e60f74dd3d3d 100644 --- a/core/java/android/os/Debug.java +++ b/core/java/android/os/Debug.java @@ -623,7 +623,7 @@ public final class Debug * *Kotlin
+ *+ * object : CountDownTimer(30000, 1000) { + * + * override fun onTick(millisUntilFinished: Long) { + * mTextField.setText("seconds remaining: " + millisUntilFinished / 1000) + * } + * + * override fun onFinish() { + * mTextField.setText("done!") + * } + * }.start() + *+ *Java
+ ** new CountDownTimer(30000, 1000) { * * public void onTick(long millisUntilFinished) { @@ -32,8 +47,8 @@ package android.os; * public void onFinish() { * mTextField.setText("done!"); * } - * }.start(); - *+ * }.start(); + ** diff --git a/core/java/android/os/Parcelable.java b/core/java/android/os/Parcelable.java index 7a624e1da26c5..a537c98fc497f 100644 --- a/core/java/android/os/Parcelable.java +++ b/core/java/android/os/Parcelable.java @@ -27,10 +27,39 @@ import java.lang.annotation.RetentionPolicy; * and restored from a {@link Parcel}. Classes implementing the Parcelable * interface must also have a non-null static field calledsummary.total-pss - *Total PPS memory usage in kB. + *Total PSS memory usage in kB. *{@code 1442} *23 *CREATOR* of a type that implements the {@link Parcelable.Creator} interface. - * + * *A typical implementation of Parcelable is:
- * - *+ * + *+ **/ public interface Parcelable { /** @hide */Kotlin
+ *+ * class MyParcelable private constructor(`in`: Parcel) : Parcelable { + * private val mData: Int = `in`.readInt() + * + * override fun describeContents(): Int { + * return 0 + * } + * + * override fun writeToParcel(out: Parcel, flags: Int) { + * out.writeInt(mData) + * } + * + * companion object { + * val CREATOR: Parcelable.Creator<MyParcelable?> + * = object : Parcelable.Creator<MyParcelable?> { + * override fun createFromParcel(`in`: Parcel): MyParcelable? { + * return MyParcelable(`in`) + * } + * + * override fun newArray(size: Int): Array<MyParcelable?> { + * return arrayOfNulls(size) + * } + * } + * } + * } + *+ *Java
+ ** public class MyParcelable implements Parcelable { * private int mData; * @@ -52,11 +81,11 @@ import java.lang.annotation.RetentionPolicy; * return new MyParcelable[size]; * } * }; - * + * * private MyParcelable(Parcel in) { * mData = in.readInt(); * } - * }+ * }