代码语言:javascript 复制 private static final int CREATE_FILE = 1; private void createFile() { Intent intent = new Intent(Intent.ACTION_CREATE_DOCUMENT); intent.addCategory(Intent.CATEGORY_OPENABLE); intent.setType("application/txt"); intent.putExtra(Intent.EXTRA_TITLE, "testfile.txt"); star...
我在创建带有"ACTION_CREATE_DOCUMENT“的PDF文件时遇到了问题。创建PDF文件仍然可以使用“公共无效onActivityResult”。然而,“公共无效的onActivityResult”最近已经被压抑。 现在我尝试用"ActivityResultLauncher“创建PDF文件。创建一个文件(0字节)。我注意到在创建文件时,没有跳转到try块(createDocument) (跳转捕捉)。如...
{action = android.intent.action.VIEW data = content://com.google.provider.NotePad/notes/ {ID} } 向用户显示注释{ID}的内容。 {action = android.app.action.EDIT data = content://com.google.provider.NotePad/notes/ {ID} } 允许用户编辑注释{ID}的内容。 {action = android.app.action.INSERT dat...
我们在MainActivity中使用ACTION_OPEN_DOCUMENT来打开文件选择器,选择文件后跳转到DocumentActivity来展示所选文件的内容。我们使用下面的代码来实现这个逻辑: MainActivity.java publicclassMainActivityextendsAppCompatActivity{privatestaticfinalintREQUEST_OPEN_DOCUMENT=1;@OverrideprotectedvoidonCreate(BundlesavedInstanceState...
ActionBatteryLow ActionBatteryOkay ActionBootCompleted ActionBugReport ActionCall ActionCallButton ActionCameraButton ActionCarrierSetup ActionChooser ActionCloseSystemDialogs ActionConfigurationChanged ActionCreateDocument ActionCreateNote ActionCreateReminder ActionCreateShortcut ActionDateChanged ActionDefault ActionDefine...
TakePicture: 调用MediaStore.ACTION_IMAGE_CAPTURE拍照,并将图片保存到给定的Uri地址,返回true表示保存成功。 TakeVideo: 调用MediaStore.ACTION_VIDEO_CAPTURE 拍摄视频,保存到给定的Uri地址,返回一张缩略图。 PickContact: 从通讯录APP获取联系人 GetContent: 提示用选择一条内容,返回一个通过ContentResolver#openInputStr...
ActionBatteryLow ActionBatteryOkay ActionBootCompleted ActionBugReport ActionCall ActionCallButton ActionCameraButton ActionCarrierSetup ActionChooser ActionCloseSystemDialogs ActionConfigurationChanged ActionCreateDocument ActionCreateNote ActionCreateReminder ActionCreateShortcut ActionDateChanged ActionDefault ActionDefine...
ActionAssist 動作附加資料 自動撤回權限動作 ActionBatteryChanged ActionBatteryLow ActionBatteryOkay ActionBootCompleted(系統啟動完成) 動作錯誤報告 ActionCall 行動呼叫按鈕 ActionCameraButton ActionCarrierSetup ActionChooser 關閉系統對話框操作 ActionConfigurationChanged ActionCreateDocument ActionCreateNote 建立提醒動作...
Activity Action: Allow the user to select and return one or more existing documents. [Android.Runtime.Register("ACTION_OPEN_DOCUMENT")] public const string ActionOpenDocument; Field Value String Implements ContentsFileDescriptor Attributes RegisterAttribute Remarks Activity Action: Allow the user to...
Intentintent=newIntent();intent.setAction(Intent.ACTION_VIEW);intent.setData(Uri.parse("tel:18755555555"));startActivity(intent); 拨打指定电话 Type属性用于指定 Data 所制定的 Uri 对应的MIME类型,通常应用于调用系统 App,比如实现查看文件(文本、图片、音频或者视频等),通过指定文件的 MIME 类型,可以让系统...