Android Question can someone help me wrap this java code?

Mrjoey

Active Member
Licensed User
Longtime User
B4X:
    private Notification setCustomViewNotification() {

        // Creates an explicit intent for an ResultActivity to receive.
        Intent resultIntent = new Intent(this, ResultActivity.class);

        // This ensures that the back button follows the recommended convention for the back key.
        TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);

        // Adds the back stack for the Intent (but not the Intent itself)
        stackBuilder.addParentStack(ResultActivity.class);

        // Adds the Intent that starts the Activity to the top of the stack.
        stackBuilder.addNextIntent(resultIntent);
        PendingIntent resultPendingIntent = stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);

        // Create remote view and set bigContentView.
        RemoteViews expandedView = new RemoteViews(this.getPackageName(), R.layout.notification_custom_remote);
        expandedView.setTextViewText(R.id.text_view, "Neat logo!");

        Notification notification = new NotificationCompat.Builder(this)
                .setSmallIcon(R.drawable.ic_launcher)
                .setAutoCancel(true)
                .setContentIntent(resultPendingIntent)
                .setContentTitle("Custom View").build();

        notification.bigContentView = expandedView;

        return notification;
    }
this code is took from an activity.
i need to wrap this as a library to use it in b4a like :
B4X:
dim n as mynotification
can someone help , thanks.
 

LucaMs

Expert
Licensed User
Longtime User
I have not ever used the notifications, but I think there are libraries ready.

http://www.b4x.com/android/forum/pages/results/?query=custom notification&page=1&prefix=0



There is a great wrapper, but he has very little time (and now he is in love with Apple, and we're screwed :D).

We should find the time and the patience to learn how to wrap (I wonder if there is a good tutorial about this or if someone will publish one).


[P.S. http://www.b4x.com/android/forum/th...-java-class-to-b4a-library.25813/#post-231025
 
Last edited:
Upvote 0

Mrjoey

Active Member
Licensed User
Longtime User
all these notifications on the forum dont have this method :
notification.bigContentView = expandedView;
therefore im trying to bear coding in java.
 
Upvote 0
Top