Z
Z
Zhaslan Ergaliev2016-12-04 11:59:37
Android
Zhaslan Ergaliev, 2016-12-04 11:59:37

How to pass data to Activity from Service via instent?

I want to open an activity when I click on a notification on Android and pass data to them from the Service via intent. I wanted to do it like this, it doesn't work

Intent notificationIntent = new Intent(this, InfoActivity.class);
        notificationIntent.putExtra("content", contenthtml);
        notificationIntent.putExtra("title", titlead);
        PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);
        notification.contentIntent = contentIntent;

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alexsamarin47, 2016-12-04
@alexsamarin47

Look at this article, maybe there is what you are looking for - developer.alexanderklimov.ru/android/theory/intent...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question