本文整理匯總了Java中android.support.v4.app.FragmentActivity.finish方法的典型用法代碼示例。如果您正苦於以下問題:Java FragmentActivity.finish方法的具體用法?Java FragmentActivity.finish怎麽用?Java FragmentActivity.finish使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.support.v4.app.FragmentActivity
的用法示例。
在下文中一共展示了FragmentActivity.finish方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onCreate
import android.support.v4.app.FragmentActivity; //導入方法依賴的package包/類
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setHasOptionsMenu(true);
// Get local Bluetooth adapter
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
// If the adapter is null, then Bluetooth is not supported
if (mBluetoothAdapter == null) {
FragmentActivity activity = getActivity();
Toast.makeText(activity, "Bluetooth is not available", Toast.LENGTH_LONG).show();
activity.finish();
}
}
示例2: onCreate
import android.support.v4.app.FragmentActivity; //導入方法依賴的package包/類
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setHasOptionsMenu(true);
// Get local Bluetooth adapter
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
// If the adapter is null, then Bluetooth is not supported
if (mBluetoothAdapter == null) {
FragmentActivity activity = getActivity();
Toast.makeText(activity, "Bluetooth is supported by this device.", Toast.LENGTH_LONG).show();
activity.finish();
}
}
示例3: onCreate
import android.support.v4.app.FragmentActivity; //導入方法依賴的package包/類
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setHasOptionsMenu(true);
// Get local Bluetooth adapter
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
// Get Encryption Keyword
mKeyword = getArguments().getString("mKeyword");
// If the adapter is null, then Bluetooth is not supported
if (mBluetoothAdapter == null) {
FragmentActivity activity = getActivity();
Toast toast = Toast.makeText(activity, "Bluetooth is not available", Toast.LENGTH_LONG);
toast.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL, 0, 0);
toast.show();
Log.d(TAG, "Bluetooth is not available");
activity.finish();
}
}
示例4: onCompleteWebDialog
import android.support.v4.app.FragmentActivity; //導入方法依賴的package包/類
private void onCompleteWebDialog(Bundle values, FacebookException error) {
FragmentActivity fragmentActivity = getActivity();
Intent resultIntent = NativeProtocol.createProtocolResultIntent(
fragmentActivity.getIntent(),
values,
error);
int resultCode = error == null ? Activity.RESULT_OK : Activity.RESULT_CANCELED;
fragmentActivity.setResult(resultCode, resultIntent);
fragmentActivity.finish();
}
示例5: onCompleteWebFallbackDialog
import android.support.v4.app.FragmentActivity; //導入方法依賴的package包/類
private void onCompleteWebFallbackDialog(Bundle values) {
FragmentActivity fragmentActivity = getActivity();
Intent resultIntent = new Intent();
resultIntent.putExtras(values == null ? new Bundle() : values);
fragmentActivity.setResult(Activity.RESULT_OK, resultIntent);
fragmentActivity.finish();
}
示例6: onViewCreated
import android.support.v4.app.FragmentActivity; //導入方法依賴的package包/類
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
printFragmentLife("onViewCreated");
Bundle argsBundle = getArguments();
if (savedInstanceState != null) {
mConfiguration = savedInstanceState.getParcelable(EXTRA_CONFIGURATION);
}
if (mConfiguration == null && argsBundle != null) {
mConfiguration = argsBundle.getParcelable(EXTRA_CONFIGURATION);
}
if (mConfiguration != null) {
if (argsBundle == null) {
argsBundle = savedInstanceState;
}
onViewCreatedOk(view, argsBundle);
setTheme();
} else {
FragmentActivity activity = getActivity();
if (activity != null && !activity.isFinishing()) {
activity.finish();
}
}
}
示例7: onCompleteWebDialog
import android.support.v4.app.FragmentActivity; //導入方法依賴的package包/類
private void onCompleteWebDialog(Bundle values, FacebookException error) {
FragmentActivity fragmentActivity = getActivity();
fragmentActivity.setResult(error == null ? -1 : 0, NativeProtocol.createProtocolResultIntent(fragmentActivity.getIntent(), values, error));
fragmentActivity.finish();
}