我有一个在我的应用程序启动时调用的类.
public class MainActivity extends Activity implements NetworkEvent.
Run Code Online (Sandbox Code Playgroud)
在这种情况下,
list = (ListView) findViewById(R.id.list);
Run Code Online (Sandbox Code Playgroud)
工作得很好.但是,如果我通过以下方式调用新意图:
String[] names = object.names();
Run Code Online (Sandbox Code Playgroud)
Intent myIntent = new Intent(MainActivity.this,SimpleList.class); myIntent.putExtra("名字",姓名); startActivityForResult(myIntent,0);
其中SimpleList定义为:
public class SimpleList extends ListActivity implements NetworkEvent
Run Code Online (Sandbox Code Playgroud)
然后我打电话的时候
list=(ListView) findViewById(R.id.list);
Run Code Online (Sandbox Code Playgroud)
Log.i("MyApp","List:"+ list);
从SimpleList类中,list为null :(
怎么会?两个类都在同一个包中.
谢谢.