title: A SQLiteConnection object for database was leaked
body: <p>I am beginner to android program getting below error, tried solution provided like clearing Google play store data on Emulator still getting same error, not using any database connection code but getting database was leaked, any help would be appreciated.</p>
  
  <pre><code>Error
  
  03-25 17:16:41.664 2335-2344/com.google.android.gms 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-25 17:16:41.669 2335-2344/com.google.android.gms 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-25 17:16:41.671 2335-2344/com.google.android.gms 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.
  03-25 17:20:42.080 2335-2344/com.google.android.gms 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-25 17:20:42.082 2335-2344/com.google.android.gms 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-25 17:20:42.376 2335-2344/com.google.android.gms 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.
  
  
  Activity A.java
  package com.lifecycle.activity.demo.activity_lifecycle;
  
  import android.content.Intent;
  import android.os.Bundle;
  import android.support.v7.app.AppCompatActivity;
  import android.util.Log;
  import android.view.View;
  import android.widget.Button;
  
  public class ActivityA extends AppCompatActivity {
  
      Button btt;
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          btt = (Button) findViewById(R.id.button);
          btt.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  Intent i = new Intent(ActivityA.this, ActivityB.class);
                  startActivity(i);
              }
          });
          Log.i("Activity A","onCreate");
      }
  
      @Override
      protected void onStart() {
          super.onStart();
          Log.i("Activity A","onStart");
      }
  
      @Override
      protected void onResume() {
          super.onResume();
          Log.i("Activity A","onResume");
      }
  
      @Override
      protected void onPause() {
          super.onPause();
          Log.i("Activity A","onPause");
      }
  
      @Override
      protected void onStop() {
          super.onStop();
          Log.i("Activity A","onStop");
      }
  
      @Override
      protected void onDestroy() {
          super.onDestroy();
          Log.i("Activity A","onDestroy");
      }
  
      @Override
      protected void onRestart() {
          super.onRestart();
          Log.i("Activity A","onRestart");
      }
  }
  
  ActivityB.java
  package com.lifecycle.activity.demo.activity_lifecycle;
  
  import android.os.Bundle;
  import android.support.v7.app.AppCompatActivity;
  import android.util.Log;
  
  /**
   * Created by karthicklove on 25/03/17.
   */
  
  public class ActivityB extends AppCompatActivity {
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_b);
          Log.i("Activity B","onCreate");
      }
  
      @Override
      protected void onStart() {
          super.onStart();
          Log.i("Activity B","onStart");
      }
  
      @Override
      protected void onResume() {
          super.onResume();
          Log.i("Activity B","onResume");
      }
  
      @Override
      protected void onPause() {
          super.onPause();
          Log.i("Activity B","onPause");
      }
  
      @Override
      protected void onStop() {
          super.onStop();
          Log.i("Activity B","onStop");
      }
  
      @Override
      protected void onDestroy() {
          super.onDestroy();
          Log.i("Activity B","onDestroy");
      }
  
      @Override
      protected void onRestart() {
          super.onRestart();
          Log.i("Activity B","onRestart");
      }
  }
  
  activity_main.xml
  &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context="com.lifecycle.activity.demo.activity_lifecycle.ActivityA"&gt;
  
      &lt;Button
          android:id="@+id/button"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="@string/button_name1"
          tools:layout_constraintTop_creator="1"
          android:layout_marginStart="134dp"
          android:layout_marginTop="216dp"
          tools:layout_constraintLeft_creator="1"
          app:layout_constraintLeft_toLeftOf="parent"
          app:layout_constraintTop_toTopOf="parent"
          android:layout_marginLeft="134dp" /&gt;
  &lt;/android.support.constraint.ConstraintLayout&gt;
  activity_b.xml
  &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical" android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
      &lt;TextView
          android:id="@+id/textView"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:text="@string/activity_b" /&gt;
  &lt;/LinearLayout&gt;
  
  AndroidManifest.xml
  &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.lifecycle.activity.demo.activity_lifecycle"&gt;
  
      &lt;application
          android:allowBackup="true"
          android:icon="@mipmap/ic_launcher"
          android:label="@string/app_name"
          android:roundIcon="@mipmap/ic_launcher_round"
          android:supportsRtl="true"
          android:theme="@style/AppTheme"&gt;
          &lt;activity android:name=".ActivityA"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
          &lt;activity android:name=".ActivityB"&gt;&lt;/activity&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>