mirror of
				https://github.com/pierre42100/ComunicAndroid
				synced 2025-10-31 17:44:04 +00:00 
			
		
		
		
	Made Database Helper object static for permanent connection.
This commit is contained in:
		| @@ -94,6 +94,11 @@ public class DatabaseHelper extends SQLiteOpenHelper { | ||||
|             ConversationsMessagesSchema.TABLE_NAME; | ||||
|  | ||||
|  | ||||
|     /** | ||||
|      * This object cached instance | ||||
|      */ | ||||
|     private static DatabaseHelper instance; | ||||
|  | ||||
|     /** | ||||
|      * Get the current database helper instance | ||||
|      * | ||||
| @@ -101,7 +106,10 @@ public class DatabaseHelper extends SQLiteOpenHelper { | ||||
|      * @return DatabaseHelper object | ||||
|      */ | ||||
|     public static synchronized DatabaseHelper getInstance(Context context){ | ||||
|         return new DatabaseHelper(context.getApplicationContext()); | ||||
|         if(instance == null) | ||||
|             instance = new DatabaseHelper(context.getApplicationContext()); | ||||
|  | ||||
|         return instance; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Pierre
					Pierre