Fixed
Status Update
Comments
vi...@google.com <vi...@google.com>
vi...@google.com <vi...@google.com> #2
Or when changing to textView.textMetricsParamsCompat still crash.
private fun setAsyncText(textView: AppCompatTextView, text: String?) {
if (!text.isNullOrEmpty()) {
val textFuture = PrecomputedTextCompat.getTextFuture(text!!, textView.textMetricsParamsCompat, null)
textView.setTextFuture(textFuture) //Crash
}
}
private fun setAsyncText(textView: AppCompatTextView, text: String?) {
if (!text.isNullOrEmpty()) {
val textFuture = PrecomputedTextCompat.getTextFuture(text!!, textView.textMetricsParamsCompat, null)
textView.setTextFuture(textFuture) //Crash
}
}
ki...@google.com <ki...@google.com>
ap...@google.com <ap...@google.com> #3
add this line :
textView.setLayoutDirection(ViewCompat.getLayoutDirection(textView));
before :
setTextFuture(....)
textView.setLayoutDirection(ViewCompat.getLayoutDirection(textView));
before :
setTextFuture(....)
Description
- Relevant code to trigger the issue.
val builder= NotificationCompat.Builder(context, SNOOZING_CHANNEL_ID)
builder.setUsesChronometer(true)
builder.setChronometerCountDown(true) throws NPE
workaround:
call builder.addExtras(Bundle()) before builder.setChronometerCountDown(true)
Origin:
This bug is linked to: