本文整理匯總了Java中com.j256.ormlite.android.apptools.OpenHelperManager.releaseHelper方法的典型用法代碼示例。如果您正苦於以下問題:Java OpenHelperManager.releaseHelper方法的具體用法?Java OpenHelperManager.releaseHelper怎麽用?Java OpenHelperManager.releaseHelper使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.j256.ormlite.android.apptools.OpenHelperManager
的用法示例。
在下文中一共展示了OpenHelperManager.releaseHelper方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: doInBackground
import com.j256.ormlite.android.apptools.OpenHelperManager; //導入方法依賴的package包/類
@Override
protected Void doInBackground(Void... voids) {
ArrayList<Track> mTrackList = Utils.musicLoader(mContext);
OrmHandler ormHandler = OpenHelperManager.getHelper(mContext, OrmHandler.class);
try {
Dao<Track, String> dbTrack = ormHandler.getDao(Track.class);
List<Track> _temp = dbTrack.queryForAll();
_temp.removeAll(mTrackList);
for (Track t :
mTrackList) {
dbTrack.createIfNotExists(t);
}
dbTrack.delete(_temp);
} catch (SQLException e) {
e.printStackTrace();
}
OpenHelperManager.releaseHelper();
return null;
}
示例2: cancelAllAlarms
import com.j256.ormlite.android.apptools.OpenHelperManager; //導入方法依賴的package包/類
private void cancelAllAlarms()
{
UpdateAlarmsService.cancelAutoUpdateAlarm( m_context );
final DatabaseHelper databaseHelper = OpenHelperManager.getHelper( m_context, DatabaseHelper.class );
if( databaseHelper != null )
{
try
{
final Dao<Launch, Integer> launchDao = databaseHelper.getDao( Launch.class );
for( final Launch launch : launchDao )
{
UpdateAlarmsService.cancelAlarmsForLaunch( launch, m_context );
}
}
catch( SQLException e )
{
e.printStackTrace();
}
OpenHelperManager.releaseHelper();
}
}
示例3: getDataPieces
import com.j256.ormlite.android.apptools.OpenHelperManager; //導入方法依賴的package包/類
/**
* Returns all the DataPieces currently within the application's database.
*
* @param {@link Context}
* @return a {@link List} of the {@link DataPiece}s within the database.
*/
public static List<DataPiece> getDataPieces(final Context context) {
final ResilienceDbHelper dBHelper = getDbHelper(context);
List<DataPiece> pieces = null;
try {
final Dao<DataPiece, String> dao = dBHelper.getDataPieceDao();
pieces = dao.queryForAll();
} catch (SQLException e) {
if (Flags.DEBUG) {
Log.e(ResilienceDbManager.class.getSimpleName(), e.getMessage());
}
} finally {
OpenHelperManager.releaseHelper();
}
return pieces;
}
示例4: doInBackground
import com.j256.ormlite.android.apptools.OpenHelperManager; //導入方法依賴的package包/類
@Override
protected Launch doInBackground( final Integer... ids )
{
Launch launch = null;
if( m_context != null )
{
final DatabaseHelper databaseHelper = OpenHelperManager.getHelper( m_context, DatabaseHelper.class );
if( databaseHelper != null )
{
try
{
Dao<Launch, Integer> launchDao = databaseHelper.getDao( Launch.class );
launch = launchDao.queryForId( ids[ 0 ] );
}
catch( final SQLException e )
{
e.printStackTrace();
}
OpenHelperManager.releaseHelper();
}
}
return launch;
}
示例5: onTerminate
import com.j256.ormlite.android.apptools.OpenHelperManager; //導入方法依賴的package包/類
@Override
public void onTerminate() {
super.onTerminate();
sSharedApplication = null;
OpenHelperManager.releaseHelper();
merlin.unbind();
}
示例6: queriedTracks
import com.j256.ormlite.android.apptools.OpenHelperManager; //導入方法依賴的package包/類
public void queriedTracks(String query) {
OrmHandler orm = OpenHelperManager.getHelper(mContext, OrmHandler.class);
try {
Dao<Track, String> mTrack = orm.getDao(Track.class);
QueryBuilder<Track, String> queryBuilder = mTrack.queryBuilder();
queryBuilder.where().like("name", "%" + query + "%").or().like("artist", "%" + query + "%").or().like("album", "%" + query + "%");
PreparedQuery<Track> preparedQuery = queryBuilder.prepare();
mTrackList = mTrack.query(preparedQuery);
} catch (SQLException e) {
e.printStackTrace();
}
OpenHelperManager.releaseHelper();
notifyDataSetChanged();
}
示例7: getBucketedTracks
import com.j256.ormlite.android.apptools.OpenHelperManager; //導入方法依賴的package包/類
public void getBucketedTracks() {
bucketBool = true;
OrmHandler orm = OpenHelperManager.getHelper(mContext, OrmHandler.class);
try {
Dao<Track, String> mTrack = orm.getDao(Track.class);
mTrackList = mTrack.queryForEq("bucket", true);
} catch (SQLException e) {
e.printStackTrace();
}
OpenHelperManager.releaseHelper();
notifyDataSetChanged();
}
示例8: releaseHelper
import com.j256.ormlite.android.apptools.OpenHelperManager; //導入方法依賴的package包/類
public void releaseHelper(DatabaseHelper helper)
{
if (databaseHelper != null) {
OpenHelperManager.releaseHelper();
databaseHelper = null;
}
}
示例9: close
import com.j256.ormlite.android.apptools.OpenHelperManager; //導入方法依賴的package包/類
public void close() throws IOException {
inService = false;
srvSocket.close();
if (helper != null) {
OpenHelperManager.releaseHelper();
helper = null;
}
Log.i(TAG, "DNS Proxy closed");
}
示例10: deinitializeHelper
import com.j256.ormlite.android.apptools.OpenHelperManager; //導入方法依賴的package包/類
public static synchronized void deinitializeHelper() {
if (dbHelper == null) {
throw new IllegalStateException("DbHelper is not initialized");
}
OpenHelperManager.releaseHelper();
dbHelper = null;
}
示例11: onDestroy
import com.j256.ormlite.android.apptools.OpenHelperManager; //導入方法依賴的package包/類
@Override
protected void onDestroy() {
super.onDestroy();
if (mDBHelper != null) {
OpenHelperManager.releaseHelper();
}
}
示例12: onDestroy
import com.j256.ormlite.android.apptools.OpenHelperManager; //導入方法依賴的package包/類
@Override
public void onDestroy() {
super.onDestroy();
if (mDBHelper != null) {
OpenHelperManager.releaseHelper();
}
}
示例13: onTerminate
import com.j256.ormlite.android.apptools.OpenHelperManager; //導入方法依賴的package包/類
@Override
public void onTerminate() {
if (dbHelper != null) {
OpenHelperManager.releaseHelper();
dbHelper = null;
}
super.onTerminate();
}
示例14: onDestroy
import com.j256.ormlite.android.apptools.OpenHelperManager; //導入方法依賴的package包/類
@Override
protected void onDestroy() {
super.onDestroy();
/*
* You'll need this in your class to release the helper when done.
*/
if (databaseHelper != null) {
OpenHelperManager.releaseHelper();
databaseHelper = null;
}
}
示例15: onDestroy
import com.j256.ormlite.android.apptools.OpenHelperManager; //導入方法依賴的package包/類
@Override
protected void onDestroy() {
// TODO Auto-generated method stub
super.onDestroy();
if (dataHelper != null) {
OpenHelperManager.releaseHelper();
dataHelper = null;
}
}