ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 64 - Associate Android Developer discussion

Report
Export

By default, the notification's text content is truncated to fit one line. If you want your notification to be longer, for example, to create a larger text area, you can do it in this way:

A.
NotificationCompat.Builder builder = new NotificationCompat.Builder(this, CHANNEL_ID).setContentText("Much longer text that cannot fit one line...").setStyle(new NotificationCompat.BigTextStyle().bigText("Much longer text that cannot fit one line..."))
Answers
A.
NotificationCompat.Builder builder = new NotificationCompat.Builder(this, CHANNEL_ID).setContentText("Much longer text that cannot fit one line...").setStyle(new NotificationCompat.BigTextStyle().bigText("Much longer text that cannot fit one line..."))
B.
.
Answers
B.
.
C.
NotificationCompat.Builder builder = new NotificationCompat.Builder(this, CHANNEL_ID).setContentText("Much longer text that cannot fit one line...").setLongText("Much longer text that cannot fit one line..."))
Answers
C.
NotificationCompat.Builder builder = new NotificationCompat.Builder(this, CHANNEL_ID).setContentText("Much longer text that cannot fit one line...").setLongText("Much longer text that cannot fit one line..."))
D.
.
Answers
D.
.
E.
NotificationCompat.Builder builder = new NotificationCompat.Builder(this, CHANNEL_ID).setContentText("Much longer text that cannot fit one line...") .setTheme(android.R.style.Theme_LongText); ...
Answers
E.
NotificationCompat.Builder builder = new NotificationCompat.Builder(this, CHANNEL_ID).setContentText("Much longer text that cannot fit one line...") .setTheme(android.R.style.Theme_LongText); ...
Suggested answer: A

Explanation:

Reference:

https://developer.android.com/training/notify-user/build-notification

asked 18/09/2024
Mk Cheng
43 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first