I have very basic ques. and it might be very simple but i am not getting it. I have an Activity where I am using some UI component. and I also have a broadcast receiver (registering from manifest) where I need to update some UI component of Activity class. Like -
Class MyActivity extends Activity
{
onCreate(){
//using some UI component lets say textview
textView.setText("Some Text");
}
updateLayout()
{
textView.setText("TextView Upadated...");
}
}
Class broadCastReceiver
{
onReceive()
{
//here I want to update My Activity component like
UpdateLayout();
}
}
For that- One solution is that make the updateLayout() method public static, and use that method in receiver class by activity reference . But I think, this is not the right way to do this.. Is there any proper way to do that?