本文整理匯總了Java中android.app.Activity.unbindService方法的典型用法代碼示例。如果您正苦於以下問題:Java Activity.unbindService方法的具體用法?Java Activity.unbindService怎麽用?Java Activity.unbindService使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.app.Activity
的用法示例。
在下文中一共展示了Activity.unbindService方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: unbindCustomTabsService
import android.app.Activity; //導入方法依賴的package包/類
public static void unbindCustomTabsService(Activity activity) {
if (Build.VERSION.SDK_INT < 15 || customTabsServiceConnection == null) {
return;
}
Activity currentActivity = currentCustomTabsActivity == null ? null : currentCustomTabsActivity.get();
if (currentActivity == activity) {
currentCustomTabsActivity.clear();
}
try {
activity.unbindService(customTabsServiceConnection);
} catch (Exception e) {
FileLog.e("tmessages", e);
}
customTabsClient = null;
customTabsSession = null;
}
示例2: stopService
import android.app.Activity; //導入方法依賴的package包/類
/**
* Bind the activity to a background service and put them into foreground
* state.
*/
private void stopService() {
Activity context = cordova.getActivity();
Intent intent = new Intent(
context, ForegroundService.class);
if (!isBind)
return;
fireEvent(Event.DEACTIVATE, null);
context.unbindService(connection);
context.stopService(intent);
isBind = false;
}
示例3: unbindCustomTabsService
import android.app.Activity; //導入方法依賴的package包/類
/**
* Unbinds the Activity from the Custom Tabs Service.
* @param activity the activity that is connected to the service.
*/
public void unbindCustomTabsService(Activity activity) {
if (mConnection == null) return;
activity.unbindService(mConnection);
mClient = null;
mCustomTabsSession = null;
mConnection = null;
}
示例4: unbindCustomTabsService
import android.app.Activity; //導入方法依賴的package包/類
/**
* Unbinds the Activity from the Custom Tabs Service.
*
* @param activity the activity that is connected to the service.
*/
public void unbindCustomTabsService(Activity activity) {
if (mConnection == null) return;
activity.unbindService(mConnection);
mClient = null;
mCustomTabsSession = null;
mConnection = null;
}
示例5: unbindCustomTabsService
import android.app.Activity; //導入方法依賴的package包/類
/**
* Unbinds the Activity from the Custom Tabs Service
*
* @param activity the activity that is connected to the service
*/
public void unbindCustomTabsService(final Activity activity) {
if (connection == null) {
return;
}
activity.unbindService(connection);
client = null;
customTabsSession = null;
}