本文整理匯總了Java中android.support.v4.app.FragmentActivity.startActivityForResult方法的典型用法代碼示例。如果您正苦於以下問題:Java FragmentActivity.startActivityForResult方法的具體用法?Java FragmentActivity.startActivityForResult怎麽用?Java FragmentActivity.startActivityForResult使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.support.v4.app.FragmentActivity
的用法示例。
在下文中一共展示了FragmentActivity.startActivityForResult方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: sendLog
import android.support.v4.app.FragmentActivity; //導入方法依賴的package包/類
public static void sendLog(FragmentActivity context) {
File file = new File(MultiProcessPreference.getDefaultSharedPreferences().getString(LOG_FILE_LOCATION, ""));
if (!file.exists())
return;
Uri contentUri = FileProvider.getUriForFile(context, "com.calebtrevino.tallystacker.file_provider", file);
if (contentUri != null) {
Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.putExtra(Intent.EXTRA_EMAIL, new String[]{"[email protected]"});
shareIntent.putExtra(Intent.EXTRA_SUBJECT, "TallyStacker Database");
shareIntent.putExtra(Intent.EXTRA_TEXT, "Please have a look");
shareIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
shareIntent.putExtra(Intent.EXTRA_STREAM, contentUri);
shareIntent.setType(context.getContentResolver().getType(contentUri));
context.startActivityForResult(Intent.createChooser(shareIntent, context.getResources().getText(R.string.send_to)), LOG_RESULT);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
MultiProcessPreference.getDefaultSharedPreferences().edit().putString(LOG_FILE_LOCATION, "").commit();
EventBus.getDefault().post(new ErrorEvent(false));
}
}, 10 * 1000);
}
}
示例2: requestSignIn
import android.support.v4.app.FragmentActivity; //導入方法依賴的package包/類
public static void requestSignIn(FragmentActivity activity) {
List<AuthUI.IdpConfig> idpConfigs = Arrays.asList(new AuthUI.IdpConfig.Builder(AuthUI.EMAIL_PROVIDER).build(),
new AuthUI.IdpConfig.Builder(AuthUI.GOOGLE_PROVIDER).build());
activity.startActivityForResult(AuthUI.getInstance()
.createSignInIntentBuilder()
.setProviders(idpConfigs)
.setTheme(R.style.AppTheme)
.setLogo(R.mipmap.ic_launcher_round)
.setAllowNewEmailAccounts(true)
.setIsSmartLockEnabled(false)
.build(),
RC_SIGN_IN);
}
示例3: startChooseSpeciesActivity
import android.support.v4.app.FragmentActivity; //導入方法依賴的package包/類
public static void startChooseSpeciesActivity(FragmentActivity activity, Fragment fragment,
int category, ArrayList<Species> species, boolean showOther) {
Intent intent = new Intent(activity, ChooseSpeciesActivity.class);
intent.putExtra(ChooseSpeciesActivity.EXTRA_SPECIES_CATEGORY, category);
intent.putExtra(ChooseSpeciesActivity.EXTRA_SPECIES_LIST, species);
intent.putExtra(ChooseSpeciesActivity.EXTRA_SHOW_OTHER, showOther);
if (fragment != null) {
fragment.startActivityForResult(intent, ChooseSpeciesActivity.SPECIES_REQUEST_CODE);
} else {
activity.startActivityForResult(intent, ChooseSpeciesActivity.SPECIES_REQUEST_CODE);
}
}