本文整理汇总了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();
}