N
N
Nikolai Zebrev2015-03-07 12:53:39
Android
Nikolai Zebrev, 2015-03-07 12:53:39

Passing data from Activity to Fragment?

Greetings!
Got a Question!
Now I sit and understand someone else's code, and rewrite it. There is a problem It is necessary to update the list in the fragment when push notification arrives (pull the function). Now I am passing the given to MainActivity from push by means

Intent intent = new Intent(this, MainActivity.class);

I accept in MainActivity
public void onNewIntent(Intent intent)
    {
        
    }

And then a stupor.
Fragments are attached to the activity using implements, and there is no way to find them by ID.
Question how to be?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Abramov, 2015-03-07
@NickoliaDeGori

And what prevents you from creating a broadcast receiver in a fragment?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question