當前位置: 首頁>>代碼示例>>Java>>正文


Java OpenHelperManager.releaseHelper方法代碼示例

本文整理匯總了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;
}
 
開發者ID:Circle-Of-Music-Makers,項目名稱:com-android,代碼行數:20,代碼來源:DatabaseSynchronization.java

示例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();
	}
}
 
開發者ID:Wavesonics,項目名稱:TMinus,代碼行數:24,代碼來源:SettingsFragment.java

示例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;
}
 
開發者ID:lolletsoc,項目名稱:dissertation-project,代碼行數:23,代碼來源:ResilienceDbManager.java

示例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;
}
 
開發者ID:Wavesonics,項目名稱:TMinus,代碼行數:27,代碼來源:LaunchLoader.java

示例5: onTerminate

import com.j256.ormlite.android.apptools.OpenHelperManager; //導入方法依賴的package包/類
@Override
public void onTerminate() {
    super.onTerminate();
    sSharedApplication = null;
    OpenHelperManager.releaseHelper();
    merlin.unbind();
}
 
開發者ID:RoRoche,項目名稱:AndroidStarter,代碼行數:8,代碼來源:ApplicationAndroidStarter.java

示例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();
}
 
開發者ID:Circle-Of-Music-Makers,項目名稱:com-android,代碼行數:15,代碼來源:TracksAdapter.java

示例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();
}
 
開發者ID:Circle-Of-Music-Makers,項目名稱:com-android,代碼行數:13,代碼來源:TracksAdapter.java

示例8: releaseHelper

import com.j256.ormlite.android.apptools.OpenHelperManager; //導入方法依賴的package包/類
public void releaseHelper(DatabaseHelper helper)
{
    if (databaseHelper != null) {
        OpenHelperManager.releaseHelper();
        databaseHelper = null;
    }
}
 
開發者ID:rogermarte,項目名稱:paddle-manager-android-app,代碼行數:8,代碼來源:DatabaseManager.java

示例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");
}
 
開發者ID:tommy4711,項目名稱:gaeproxy,代碼行數:10,代碼來源:DNSServer.java

示例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;
}
 
開發者ID:yeputons,項目名稱:ofeed,代碼行數:8,代碼來源:DbHelper.java

示例11: onDestroy

import com.j256.ormlite.android.apptools.OpenHelperManager; //導入方法依賴的package包/類
@Override
protected void onDestroy() {
    super.onDestroy();
    if (mDBHelper != null) {
        OpenHelperManager.releaseHelper();
    }
}
 
開發者ID:facetome,項目名稱:Interceptor,代碼行數:8,代碼來源:BaseActivity.java

示例12: onDestroy

import com.j256.ormlite.android.apptools.OpenHelperManager; //導入方法依賴的package包/類
@Override
public void onDestroy() {
    super.onDestroy();
    if (mDBHelper != null) {
        OpenHelperManager.releaseHelper();
    }
}
 
開發者ID:facetome,項目名稱:Interceptor,代碼行數:8,代碼來源:BaseFragment.java

示例13: onTerminate

import com.j256.ormlite.android.apptools.OpenHelperManager; //導入方法依賴的package包/類
@Override
public void onTerminate() {
    if (dbHelper != null) {
        OpenHelperManager.releaseHelper();
        dbHelper = null;
    }
    super.onTerminate();
}
 
開發者ID:AMOS-2015,項目名稱:amos-ss15-proj2,代碼行數:9,代碼來源:MainApplication.java

示例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;
	}
}
 
開發者ID:FreeDevWA,項目名稱:AndroidDevModels,代碼行數:13,代碼來源:ViewTeacherRecordActivity.java

示例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;
	}
}
 
開發者ID:liufeiit,項目名稱:itmarry,代碼行數:10,代碼來源:MyRwTab.java


注:本文中的com.j256.ormlite.android.apptools.OpenHelperManager.releaseHelper方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。