Is this the Android Notification Layout (RemoteView) for Android?

On my phone, HTC RemoteView for notifications looks like the image below ...

enter image description here

I would like to use the same layout (image, bold text and small text) for notification in my application, but I cannot figure out if it is an Android layout layout or not. I created my own layout, but this is not entirely true, and I would like to stick to the “standard” one, if possible.

Using eclipse, I tried typing in android.R.layout.to find out what the suggestions were, but I don't see anything with a name that would suggest a notification layout.

Is this an Android layout for Android? If so, how do I access it?

+5
source share
1

Android, . API , , . NotificationCompat.Builder :

Intent notificationIntent = new Intent(this, ActivityHome.class);
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, PendingIntent.FLAG_CANCEL_CURRENT);

NotificationCompat.Builder builder = new NotificationCompat.Builder(this);
builder.setContentIntent(pendingIntent)
        .setWhen(System.currentTimeMillis())
        .setTicker(getText(R.string.notification_ticker))
        .setSmallIcon(R.drawable.notification_icon)
        .setContentTitle(getText(R.string.notification_title))
        .setContentText(getText(R.string.notification_text));

mNotificationManager.notify(NOTIFICATION_ID, builder.getNotification());

Notification:

Notification notification = new Notification(R.drawable.notification_icon, getText(R.string.notification_ticker), System.currentTimeMillis());

Intent notificationIntent = new Intent(this, ActivityHome.class);
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, PendingIntent.FLAG_CANCEL_CURRENT);

notification.setLatestEventInfo(this, getString(R.string.notification_title), getText(R.string.notification_text), pendingIntent);

mNotificationManager.notify(NOTIFICATION_ID, builder.getNotification());
+5

All Articles