我有一个“MainActivity 类”,在里面我有单选按钮的对象。我在'MainActivity'中有另一个类'classB'我如何能够从classB访问单选按钮检查状态“RB1.isChecked()”?
public class MainActivity extends Activity
{
public RadioButton RB1
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.test_layout);
RB1 = (RadioButton)findViewById(R.id.radioButtonA);
}
public class classB extends BroadcastReceiver
{
}
}