当前位置: 首页>>代码示例>>Java>>正文


Java FragmentActivity.finish方法代码示例

本文整理汇总了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();
    }
}
 
开发者ID:hardik-dadhich,项目名称:bluetooth-chat-appliction,代码行数:15,代码来源:BluetoothChatFragment.java

示例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();
    }
}
 
开发者ID:tkmarsh,项目名称:SmartRC,代码行数:15,代码来源:BluetoothChatFragment.java

示例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();
    }
}
 
开发者ID:paulinog,项目名称:SecretTalk,代码行数:22,代码来源:BluetoothChatFragment.java

示例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();
}
 
开发者ID:eviltnan,项目名称:kognitivo,代码行数:14,代码来源:FacebookDialogFragment.java

示例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();
}
 
开发者ID:eviltnan,项目名称:kognitivo,代码行数:10,代码来源:FacebookDialogFragment.java

示例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();
        }
    }
}
 
开发者ID:Loofer,项目名称:Watermark,代码行数:28,代码来源:BaseFragment.java

示例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();
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:6,代码来源:FacebookDialogFragment.java


注:本文中的android.support.v4.app.FragmentActivity.finish方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。