我有一个像这样的名为 ListApp 的应用程序
public class ListApp extends Application {
public static RSmovies[] appRsMovie=new RSmovies[1];
public static ImageDownloader id =new ImageDownloader();
public static String cur=null;
public static String movieGetInfo="http://hive.tn/TMDb/test11.php?param=";
}
在我的第一个活动中,我尝试在新线程中对 appRsMovie 进行修改,如下所示
new Thread(new Runnable() {
@Override
public void run() {
try {
InputStream source = retrieveStream("http://hive.tn/TMDb/test6.php");
Gson gson = new Gson();
Reader reader = new InputStreamReader(source);
ListApp.appRsMovie = gson.fromJson(reader, RSmovies[].class);
lv
.setAdapter(new LazyAdapter1(
ListControlActivity.this, z));
} catch (Exception e) {
e.printStackTrace();
}
}
}).start();
应用程序崩溃,这是我得到的例外
12-26 17:21:55.643: W/dalvikvm(958): Exception Ljava/lang/RuntimeException; thrown during Lcom/test/list/ListApp;.<clinit>