Realbitt
Realbitt

Reputation: 408

android - send some data to opened activity from broadcast

i have opened activity with disabled button, this activity when it opened automatically sends SMS message(Query Message) to our service provider . (that's the mission of this activity ).

NOW the trick i have broadcastreceiver listen to reply of my Query Message in some conditions i want to Enable button on the already opened activity .

in simple words - i want to enable, the disabled button in activity according of received message in broadcastreceiver while activity opened?

thanks

Upvotes: 1

Views: 162

Answers (1)

EvZ
EvZ

Reputation: 12179

If you already have registered BroadcastReceiver in this activity than just use setEnabled(true) in onReceive method:

@Override
public void onReceive(Context context, Intent intent) { 
     button.setEnabled(true);
}

Upvotes: 1

Related Questions