0

Github: https://github.com/jjvang/AnimationDemo

I am not using an SQlite data base unless creating a public class with data counts then perhaps. I read thru another question which has my same error: SQLiteConnection databases leak when running emulator

03-17 04:36:01.301 7516-7526/? W/SQLiteConnectionPool: A SQLiteConnection object for database '+data+user+0+com_google_android_gms+databases+metrics_db' was leaked!  Please fix your application to end transactions in progress properly and to close the database when it is no longer needed.
03-17 04:36:01.301 7516-7526/? W/SQLiteConnectionPool: A SQLiteConnection object for database '+data+user+0+com_google_android_gms+databases+help_responses_db_18' was leaked!  Please fix your application to end transactions in progress properly and to close the database when it is no longer needed.
03-17 04:36:01.301 7516-7526/? W/SQLiteConnectionPool: A SQLiteConnection object for database '+data+user+0+com_google_android_gms+databases+auto_complete_suggestions_db' was leaked!  Please fix your application to end transactions in progress properly and to close the database when it is no longer needed.

Code of DataBase:

public class YourPojo {
        static int [] imageResources = {R.drawable.capture1,R.drawable.capture2,R.drawable.capture3,R.drawable.capture4,R.drawable.capture5};
        static String[] imageText = {"egas", "gasdg", "gasdga", "four", "five"};
        static String[] imageDifferent = {"new", "new", "new", "new", "new"};
    }

PagerAdapter:

public class customSwip extends PagerAdapter {
        YourPojo yourPojo;
        private int [] imageResourcess = yourPojo.imageResources;
        private Context ctx;
        private LayoutInflater layoutInflater;   

        public customSwip(Context c) {
            ctx=c;
        }
        @Override
        public int getCount() {
            return imageResourcess.length;
        }

        @Override
        public Object instantiateItem(ViewGroup container, int position) {
            layoutInflater = (LayoutInflater) ctx.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            View itemView=layoutInflater.inflate(R.layout.activity_custom_swip,container,false);
            ImageView imageView=(ImageView) itemView.findViewById(R.id.swip_image_view);
            TextView textHmong=(TextView) itemView.findViewById(R.id.different);
            TextView textEnglish=(TextView) itemView.findViewById(R.id.english);
            imageView.setImageResource(yourPojo.imageResources[position]);
            final String dummytext = yourPojo.imageText[position];
            textHmong.setText(yourPojo.imageDifferent[position]);
            textEnglish.setText(yourPojo.imageText[position]);
            container.addView(itemView);
            imageView.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    Toast.makeText(ctx, "" + dummytext, Toast.LENGTH_SHORT).show();
                }
            });
            return itemView;
        }
        @Override
        public void destroyItem(ViewGroup container, int position, Object object) {
        }
        @Override
        public boolean isViewFromObject(View view, Object object) {
            return  (view==object);
        }
    }

MainActivity:

public class MainActivity extends AppCompatActivity {
YourPojo yourPojo;
    ViewPager viewPager;
    customSwip  customSwip;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        viewPager=(ViewPager)findViewById(R.id.viewPager);
        customSwip=new customSwip(this);
        viewPager.setAdapter(customSwip);

        Button button = (Button)findViewById(R.id.button);
        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                // SOMEHOW PASS THESE DATA TO customSWIP to set new values
                int [] imageResources2 ={R.drawable.capture2,R.drawable.capture2,R.drawable.capture5,R.drawable.capture2,R.drawable.capture2};
                yourPojo.imageResources = imageResources2;
                String[] imageText2 = {"new", "two", "three", "four", "five"};
                yourPojo.imageText = imageText2;
                String[] imageHmong2 = {"new", "new", "new", "new", "new"};
                yourPojo.imageDifferent = imageHmong2;

                viewPager.setAdapter(customSwip);
            }
        });

    }
}

Found Solution: Open Settings - Apps - Google Play Services - MANAGE SPACE - CLEAR ALL DATA

I read the solution to be the statement above but I was unable to find the "APPS" part in settings. I even used the search function which didn't come up. SCREEN SHOOT HERE

Please advise.

Thank You!

Community
  • 1
  • 1
ojboba
  • 61
  • 1
  • 7
  • I think it means on the device, i.e., Settings->Apps->PlayServicesApp->Clear stuff. (I looked at the link, it definitely means the device- remember logcat in Android Studio is a window to your device) Could you post the code where you create your database anyway? Or anywhere relevant to this- i.e., if you happen to perform gms operations anywhere that this appears, you're loading a map, or you're accessing a db of your own? It could still be a bug in the library as opposed to your code – Saik Caskey Mar 17 '17 at 12:16
  • Another option might be to strip out those library dependencies if you happen to just depend on the whole play services and don't use the libraries where the google maps services (gms) leaks are in your App – Saik Caskey Mar 17 '17 at 12:18
  • I see! I went ahead and cleared out the data from the Google Play Store app and it stopped giving me the error, not sure honestly why but I'll go with it. I also went ahead and posted the rest of my code. Thanks for the advice! – ojboba Mar 17 '17 at 13:05

0 Answers0