我试图在我的应用程序中使用asynctask在Splash页面中加载一些数据,但是应用程序停留在启动画面,并且logcat打印:
Default buffer size used in BufferedOutputStream constructor. It would be better to be explicit if an 8k buffer is required.
这是我的代码
package com.appkon.hdtvs;
public class Splash extends Activity {
private ChannelDB mDB;
private TextView loading;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.splash);
AppConnect.getInstance(this);
loading =(TextView)findViewById(R.id.loading);
}
private class SetDB extends AsyncTask<String, String, String> {
@Override
protected String doInBackground(String... arg0) {
// TODO Auto-generated method stub
try {
if (tabIsExist(null)==true){
mDB.Reset();
Bitmap bigbang1 = BitmapFactory.decodeResource(getResources(), R.drawable.bigbang1);
Bitmap bigbang2 = BitmapFactory.decodeResource(getResources(), R.drawable.bigbang2);
mDB.createchannelEntry(new ChannelPoster(castle4, "灵书妙探 (第四季)" ,"http://appkon.com/hdtvs/channel/castle4.xml" ,"http://movie.douban.com/subject/6742616/" ));
mDB.createchannelEntry(new ChannelPoster(castle3, "灵书妙探 (第三季)" ,"http://appkon.com/hdtvs/channel/castle4.xml" ,"http://movie.douban.com/subject/4836898/" ));
}
}catch (Exception e) {
Intent i = new Intent();
i.setClassName("com.appkon.hdtvs",
"com.appkon.hdtvs.HDtvs");
finish();
startActivity(i);
}
return null;
}
protected void onProgress(String load) {
loading.setText("载入中···");
}
protected void onPostExecute(String finish) {
loading.setText("载入完成");
}
}
public boolean tabIsExist(String channelS_TABLE){
boolean result = false;
if(channelS_TABLE == null){
return false;
}
Cursor cursor= ChannelDB.check();
startManagingCursor(cursor);
try {
if(cursor.moveToNext()){
int count = cursor.getInt(0);
if(count>0){
result = true;
}
}
} catch (Exception e) {
Log.e(this.toString(),"error:"+e.toString());
Intent intent = new Intent(this,HDtvs.class);
startActivity(intent);
this.finish();
}
return result;
}
}
那么似乎是什么问题?是因为我的res图像太大了。
答案 0 :(得分:0)
某处使用了BufferedOutputStream但没有使用size(第二个参数)构造。也许你用libs搞乱了。