我的 MainActivity 课程是:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
UserInterface_Main UIMain = new UserInterface_Main();
setContentView(R.layout.activity_main);
UIMain.ExpendableListView();
}
另一个 Activity 类是:
public class UserInterface_Main extends Activity{
ExpandableListView exv;
public void ExpendableListView()
{
Context context = getApplicationContext();
exv=(ExpandableListView)findViewById(R.id.elv1);
exv.setAdapter(new MAdapter(context));
}
现在告诉我如何从类中调用ExpendableListView()
方法。MainActivity