草庐IT

ACTION_INTENT

全部标签

android - 在 Android 中发送包含哈希 # 符号的 ACTION_CALL Intent

我遇到井号被截断的问题。有人知道解决方案吗?在我的情况下,使用unicode或%23不起作用。现在调用的号码是*101Stringuri="tel:"+"*101#";//Stringuri="tel:"+"*101\u0023";Intentintent;intent=newIntent(Intent.ACTION_CALL,Uri.parse(uri)); 最佳答案 找到解决办法:StringencodedHash=Uri.encode("#");这成功了...... 关于andro

java - 调用 Intent.ACTION_CALL 时出现 ActivityNotFoundException

我在执行Intent.ACTION_CALL操作时得到ActivityNotFoundException。我找到了很多链接,但所有链接都无法解决我的问题。它有时会给我异常android.content.ActivityNotFoundException:NoActivityfoundtohandleIntent{act=android.intent.action.CALLdat=tel:xxx-xxx-xxxxpkg=com.android.phone(hasextras)}我在我的项目中使用了以下代码Stringcontact_number="123456789";Intentcal

android - 为什么我总是从 onTouchEvent 获得 ACTION_DOWN

我从View扩展了我的类。我重写了onTouchEvent函数。但是,我只能得到ACTION_DOWN事件。不是任何ACTION_UP或ACTION_MOVE。我应该怎么做才能获得这些事件?我只重写了onTouchEvent和onDraw函数。应用程序中只有这个View@OverridepublicbooleanonTouchEvent(MotionEventevent){System.out.println("event:"+event.getAction());returnsuper.onTouchEvent(event);} 最佳答案

Android getIntent() 返回第一个 Intent

我开发了一个应用程序来下载视频文件并将其存储在SD卡中。在此过程中,我还使用NotificationManager将下载进度和状态更新为状态栏通知。我的名为DownloadTask.java的类扩展了AsyncTask。因此,我在这里使用onProgressUpdate()方法更新进度,其中我使用NotificationManager来达到目的。除了在下载完成后我想单击通知以打开特定的视频文件之外,一切都像一个魅力。所以这就是我所做的:mNotificationManager=(NotificationManager)mContext.getSystemService(Context.

android - 如何创建打开调用日志 Activity 的 Intent?

我想创建一个Intent来打开显示当前设备通话记录的屏幕?我如何指定这样的Intent? 最佳答案 Barmaley引导我走上正确的道路,我将类型设置为Calls.ContentType。IntentshowCallLog=newIntent();showCallLog.setAction(Intent.ACTION_VIEW);showCallLog.setType(CallLog.Calls.CONTENT_TYPE);context.startActivity(showCallLog);这个Intent应该可以解决问题。

android - 使用 Intent 调用电话时需要权限吗?

在我的一个应用程序中,我使用以下代码调用电话:Intentintent=newIntent(Intent.ACTION_CALL,Uri.parse(...));startActivity(intent);文档说我确实需要以下list许可才能这样做:这真的需要吗?我不明白手机和相机功能之间的区别。使用手机Intent时,我确实需要许可,但我不需要相机Intent的许可:Intentintent=newIntent(MediaStore.ACTION_IMAGE_CAPTURE);...startActivityForResult(intent,1);是否有关于在Intent的帮助下触发

android - ACTION_SEND 强制发送电子邮件

每次我创建一个从我的应用程序发送电子邮件的操作时,它都会提示许多选项,包括QR客户端...有没有办法强制只通过电子邮件客户端发送?发送邮件代码Stringrec[]={owner.email};i=newIntent(Intent.ACTION_SEND);i.setType("text/plain");i.putExtra(android.content.Intent.EXTRA_EMAIL,rec);i.putExtra(android.content.Intent.EXTRA_SUBJECT,"RE:"+desc);i.putExtra(android.content.Inten

android - DialogFragment 上的 ActionBar Action

我有一个DialogFragment,它使用setStyle(STYLE_NORMAL,R.style.Theme_App)设置为全屏样式。DialogFragment显示正常,但向上操作(ActionBar上的homeAsUp操作)不起作用。我尝试在DialogFragment中实现onOptionsItemSelected但它从未被调用。有没有办法在DialogFragment中获取向上Action回调,以便我可以忽略它?作为引用,我使用的是ActionBarCompat。 最佳答案 这是不可能的,但是使用工具栏可以解决这个问题

android - 如何使用 com.android.camera.action.CROP 设置输出图像

我有裁剪图像的代码,如下所示:publicvoiddoCrop(){Intentintent=newIntent("com.android.camera.action.CROP");intent.setType("image/");Listlist=getPackageManager().queryIntentActivities(intent,0);intsize=list.size();if(size==0){Toast.makeText(this,"Cantfindcropapp").show();return;}else{intent.setData(selectImageUr

android - ACTION_SEND 用于发送短信

我想打开native应用程序发送短信,但应该已经有电话号码了。我找到了ACTION_SEND但是当我调用我的函数时返回错误:04-2611:59:15.991:ERROR/AndroidRuntime(20198):android.content.ActivityNotFoundException:NoActivityfoundtohandleIntent{act=android.intent.action.SENDTO(hasextras)}此处显示我的代码:privatevoidsmsSend(Stringnumber){Intentintent=newIntent(Intent.