1
public void CustomNotification(String title, String adress) {

                 RemoteViews remoteViews = new RemoteViews(getPackageName(),
                         R.layout.customnotification);        
                     Intent intent = new Intent(this, MainActivity.class);

                 PendingIntent pIntent = PendingIntent.getActivity(this, 0, intent,
                         PendingIntent.FLAG_UPDATE_CURRENT);
                 Uri alarmSound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
                 NotificationCompat.Builder builder = new NotificationCompat.Builder(this)

                         .setSmallIcon(R.drawable.ic_launcher)

                         .setTicker("Custom Notification Ticker")
                         .setPriority(Notification.PRIORITY_MAX)
                         .setAutoCancel(true)

                         .setContentIntent(pIntent)
                         .setSound(alarmSound)

                         .setContent(remoteViews);

                 remoteViews.setTextViewText(R.id.title, title);
                 remoteViews.setTextViewText(R.id.text, adress);        
                 NotificationManager notificationmanager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);        
                 notificationmanager.notify(0, builder.build());

             }






 <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
<!-- try this-->
            android:layout_height="100dp"
        android:padding="8dp" >

        <ImageView
            android:id="@+id/thumbnail"
            android:layout_width="80dp"
            android:layout_height="80dp"
            android:layout_alignParentLeft="true"
            android:layout_marginRight="8dp"
            android:background="@drawable/ic_launcher" />

        <TextView
            android:id="@+id/title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignTop="@+id/thumbnail"
            android:layout_toRightOf="@+id/thumbnail"
            android:text="Heading"
            android:textStyle="bold" />
                     <TextView
            android:id="@+id/text"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_below="@id/title"
            android:layout_marginTop="1dip"
            android:layout_toRightOf="@+id/thumbnail" />

    </RelativeLayout>

I am printing text in text-view Dynamically but when text increases then the text is partly visible in text-view even if I increase the height of textView manually. Then also it isn't showing all text.

please suggest me. How can I fix it?

Screenshot

Sharad Chauhan
  • 4,821
  • 2
  • 25
  • 50
Research Development
  • 884
  • 1
  • 19
  • 39

1 Answers1

0

use big style text instead of small text on notification builder.

Notification notif = new Notification.Builder(mContext)
     .setContentTitle("New mail from " + sender.toString())
     .setContentText(subject)
     .setSmallIcon(R.drawable.new_mail)
     .setLargeIcon(aBitmap)
     .setStyle(new Notification.BigTextStyle()
         .bigText(aVeryLongString))
     .build();
Sharad Chauhan
  • 4,821
  • 2
  • 25
  • 50