0

I was trying to do some data loading in Splash page in my app using asynctask, but the app stuck at the splash screen, and logcat print:

Default buffer size used in BufferedOutputStream constructor. It would be better to be explicit if an 8k buffer is required. 

Here are my code

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;
        }


    }

So what seem to be the problem? Is that because my res images are too big.

oratis
  • 818
  • 1
  • 9
  • 29

1 Answers1

0

Somewhere a BufferedOutputStream is used but not constructed with a size (second argument). Maybe you used libs do the mess.

lony
  • 6,733
  • 11
  • 60
  • 92