MarcoS
MarcoS

Reputation: 17711

Android, how to update a textView in secondary activity from BroadcastReceiver.onReceive()?

I have an Activity class (WiFiTest), inside which I have defined a private class (WiFiScanReceiver) which extends BroadcastReceiver. In the onReceive() method of WiFiScanReceiver I would like to update a widget (position TextView) defined in a secondary activity (Positioning).

When I try to retrive the position

TextView (

    position = (TextView) findViewById(R.id.position);
),

I always get a null value, even when the secondary activity (Positioning) is active.

Any Hints?

Upvotes: 0

Views: 487

Answers (1)

ernazm
ernazm

Reputation: 9258

Register another BroadcastReceiver in 2nd Activity and manage it's views there.

Upvotes: 1

Related Questions