android


NotificationCompat.BigTextStyle not displaying big text and not multiple lines in android


I have applied BigTextStyle to NotificationCompat.Builder , but it will not display big text in notification list.
i have used bellow code.
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0,
intent,
PendingIntent.FLAG_ONE_SHOT);
NotificationCompat.BigTextStyle bigxtstyle =
new NotificationCompat.BigTextStyle()
.bigText(data.getMessage())
.setBigContentTitle(title)
.setSummaryText(data.getMessage());
Uri defaultSoundUri= RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this)
.setStyle(bigxtstyle)
.setSmallIcon(R.mipmap.ic_launcher)
.setContentTitle(title)
.setContentText(data.getMessage())
.setAutoCancel(true)
.setSound(defaultSoundUri)
.setContentIntent(pendingIntent)
.setPriority(NotificationCompat.PRIORITY_MAX)
.setLargeIcon(BitmapFactory.decodeResource(getResources(),R.mipmap.ic_launcher));
NotificationManager notificationManager =
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(id, notificationBuilder.build());

Related Links

Android - Alarms sometimes fires at the wrong time using AlarmManager
detect listItem from button click
CoordinatorLayout: Hiding/Showing half visible toolbar?
How to fix Null pointer exception in on clicking XML files in Eclipse IDE
Android: how to get data from sensor in specific frequency ? [closed]
Implicit Intent with user-specified action
Android Toolbar becomes translucent when navigating back
android - how to create remote xml styles
Is there a way to capture memory usage of a specific android app using appium
Android - OpenCV Native Camera Library for Android 5.0 onwards?
Getting user credentials using Google+ API
How to change Brigthness from Window manager View?
AndroidKeyStore getEntry is consistently failing after certain point
Animation in finish() not working
Get Correct index in SimpleAdapter listview
can i setup a onItemClickListener in android system 's sms inbox to start a custom activity´╝č

Categories

HOME
django
cygwin
ng-idle
pascal
battery
gradient
sublimetext
grafana
javacc
carousel
switch-statement
rds
big-o
ado.net
babeljs
crystal-reports-2013
fosrestbundle
openstreetmap
enterprise-architect
atlassian
swagger-2.0
enterprise-miner
breadth-first-search
imagemap
roslyn
syntax-highlighting
motion-detection
pylons
bioinformatics
jaws
winpe
google-cast
aws-codecommit
mockjax
utorrent
laravel-eloquent
code-snippets
android-gridview
login-script
dynamic-jasper
hunspell
modalviewcontroller
baidu-map
cin
apache-stanbol
visa
movilizer
flask-login
openresty
lampp
dtsearch
geotiff
convex-optimization
posixct
arules
oozie-coordinator
testrail
visual-studio-2008-sp1
stripe-connect
hadoop-2.7.2
preprocessor
envi
model-associations
wso2developerstudio
aurora
project-organization
cortex-m
fuzzywuzzy
ascii-art
rasterize
spring-retry
linklabel
assertion
tfs-workitem
avisynth
extjs-grid
text-search
doctype
snackbar
mraid
uvc
fail2ban
android-cookiemanager
metatrader5
mobility
draw2d-js
radiant
koala
artemis
light
hidapi
script#
rolify
asdf
octal
insert-id
argouml
qtconcurrent
boost-msm
vfs
fitbounds
flex-mobile
procedures
screen-size
u2netdk
objective-j
cruisecontrol.rb
delimited-text
addchild
opml
flvplayback
technical-debt

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App