【发布时间】:2011-02-18 04:12:09
【问题描述】:
我试图在您按下按钮后创建一个具有多项选择对话框的活动。在那里,您可以从列表中进行选择。但是这些东西是在对话框出现之前从 web 方法接收到的。
所以我在 onCreate 中接收到它们后创建了一个字符串数组,以便在那里以正确的大小对其进行初始化。 但是我的对话框方法然后无法获取数组,因为它可能超出了它的范围。 我的代码是这样的
@Override
protected Dialog onCreateDialog(int id)
//Here is where the array is loaded to the multiple select dialog
etc
@Override
public void onCreate(Bundle savedInstanceState)
//Here is where i initialise the array and get its contents
etc
我无法在课程开始时初始化我的数组,因为我还不知道它的大小。 这与我的变量范围有关,我很困惑
【问题讨论】: