Jump to content

Hi LTT Programmers,

 

I'm using RemoteViews in Android Studio with a custom notification the only thing is that I'm having issues with it now showing the small icon and the App Name.

 

Thanks hope I have made some sense?

 

Intent notificationIntent = new Intent(mContext, CardDemoActivity.class);
        notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);

        PendingIntent pendingIntent = PendingIntent.getActivity(mContext,0,notificationIntent,0);

        RemoteViews remoteView = new RemoteViews(mContext.getPackageName(), R.layout.notifcation_player);
        remoteView.setImageViewResource(R.id.notif_appIcon, R.drawable.app_logo);
        remoteView.setTextViewText(R.id.notif_playing, title);
        remoteView.setTextViewText(R.id.notif_preacher, preacher);

        NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(mContext);

        mBuilder.setSmallIcon(R.drawable.app_logo);
        mBuilder.setContent(remoteView);
        //mBuilder.setAutoCancel(true);
        mBuilder.setContentIntent(pendingIntent);

        NotificationManager notificationManager = (NotificationManager) mContext.getSystemService(mContext.NOTIFICATION_SERVICE);
        notificationManager.notify(1, mBuilder.build());

 

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×