當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。