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!