0
我正在使用以下方法在用戶設備上生成文件,然後通過電子郵件將它發送給我。在Android片段中使用公共無效的onComplete(File outfile)方法
new ActivityDumpUtil(FragmentRequestIcons.this, outfile, new ActivityDumpUtil.ActivityDumpCallback() {
@Override
public void onComplete (File outfile) {
Intent intent = new Intent(android.content.Intent.ACTION_SEND);
intent.setType("text/plain");
Uri uri = Uri.fromFile(outfile);
intent.putExtra(android.content.Intent.EXTRA_STREAM, uri);
intent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[] { "************" });
intent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Icon Support");
intent.putExtra(android.content.Intent.EXTRA_TEXT, "I am using " + Build.DEVICE + " with Android version " + Build.VERSION.RELEASE + " on " + getResources().getString(R.string.app_name));
startActivity(Intent.createChooser(intent, "Send eMail.."));
finish();
}
})
我最近有這樣一個活動,但由於IM機器人會用抽屜式導航上午片段現在想要它。
當然finish()將不能在一個片段中工作。我怎樣才能從我的片段做出這項工作?
我該怎麼辦呢? – Bignadad
見編輯。但我認爲讓你的片段成爲一個片段活動更容易。 http://developer.android.com/reference/android/support/v4/app/FragmentActivity.html –
我想過,但即時通訊使用導航抽屜。如果我這樣做,我將不得不重新加載導航抽屜。我以這種方式開始,但把所有東西都放在碎片中似乎是要走的路。我會嘗試你更新的答案。感謝您的回覆 – Bignadad