Im trying to make my custom notification similar to this one
I found a bunch of similar questions here on SO and examples on the internet but no one helped me.
Here is my code:
RemoteViews bigView = new RemoteViews(mContext.getApplicationContext().getPackageName(), R.layout.notification_playback);
Intent i = new Intent(MainActivity.ACTION_PLAYER, null, mContext, MainActivity.class);
i.putExtra("CURRENT_TRACK", t);
i.setFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT | Intent.FLAG_ACTIVITY_SINGLE_TOP);
PendingIntent pi = PendingIntent.getActivity(mContext, 0, i, 0);
Notification n = new NotificationCompat.Builder(mContext)
.setContentTitle(t.getName())
.setContentText(t.getArtistName())
.setContentIntent(pi)
.setSmallIcon(R.drawable.ic_notification)
.setLargeIcon(BitmapFactory.decodeResource(mContext.getResources(), R.drawable.ic_launcher))
.setOngoing(true)
.setContent(bigView)
.setWhen(System.currentTimeMillis())
.build();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
n.bigContentView = bigView;
NotificationManager notifyMgr = (NotificationManager)mContext.getSystemService(Context.NOTIFICATION_SERVICE);
notifyMgr.notify(0, n);
It appears in default size and become a size I expect only after long tap on it.
Is it possible to make it a big size immediately without long tap ? And how can I do it if so ? Thanks!