no activity found to handle intent android что это
Действия не найдены для работы с Intent: android.intent.action.VIEW
Это мой код для воспроизведения записанного аудио файла 3gp
Но при запуске его на моем устройстве HTC (Android 2.2 Froyo) появляется исключение:
В планшете Galaxy он работает нормально. Как я могу решить эту проблему?
ОТВЕТЫ
Ответ 1
Адресам Url должно предшествовать http://
вызывает исключение ActivityNotFoundException. Если вы добавите «http://», проблема будет решена.
Может не помогать OP, но я оказался здесь в поисках того же исключения и, возможно, он помогает другим.
Ответ 2
Это правильный способ сделать это.
вам нужно импортировать файл android.webkit.MimeTypeMap;
Ответ 3
Если вы также получаете эту ошибку при попытке открыть веб-страницу из своего приложения Android, это связано с тем, что ваш URL-адрес выглядит следующим образом:
вместо: https://www.google.com или http://www.google.com
добавьте этот код в свою активность/фрагмент:
Ответ 4
Ответ Maragues заставил меня проверить выход logcat. Появляется, что путь, который вы передаете Uri, должен быть префикс с помощью file:/
Так как это локальный путь к вашему хранилищу.
Вы также можете слишком взглянуть на сам путь.
Точка монтирования, кажется, появляется дважды в полном пути.
Ответ 5
Для меня при попытке открыть ссылку:
Я получил ту же ошибку android.content.ActivityNotFoundException: No Activity found to handle Intent
Проблема заключалась в том, что у меня не было приложения, которое может открывать URL-адреса (т. браузеров), установленных на моем телефоне. Поэтому после установки браузера проблема была решена.
* Урок: убедитесь, что есть хотя бы одно приложение, которое обрабатывает намерение, которое вы вызываете *
Ответ 6
У меня была такая же проблема, поэтому я рассматривал намерение, которое зарегистрировано в LogCat. При просмотре видео в Галерее он назвал то же намерение Intent.View, но установил Type в «audio/*», который исправил мою проблему, и не требует импорта MimeTypeMap. Пример:
Ответ 7
Если вы не передаете правильный веб-URL и у вас нет браузера, возникает ActivityNotFoundException, поэтому проверьте эти требования или обработайте исключение явно. Это может решить вашу проблему.
Ответ 8
Было ли это исключение даже изменено на
Но благодаря @Stan я получил очень простое, но полезное решение:
Uri.fromFile(File(content)) вместо Uri.parse(path)
Надеюсь, это поможет кому-то решить его проблему.
Ответ 9
Если у вас есть эти ошибки в вашем logcat, используйте этот код, это поможет мне
Ответ 10
Проверьте этот полезный метод:
Ответ 11
У меня есть две идеи:
Во-первых: если вы хотите играть в 3gp файл, вы должны использовать mime-типы «audio/3gpp» или «audio/mpeg»
И во-вторых: вы можете попробовать использовать метод setData(data) для intent без какого-либо типа mime.
No Activity found for handling Intent
I have a WebView app with a list of links (sopcast stream). This app requires SopCast Player to be installed. If not, the app crashes.
How can I fix that?
4 Answers 4
Make sure if you have an Intent leading towards another activity you have that activity listed in your Manifest file
IE, if I want the following code to work
my manifest needs to have
It looks like you’re trying to send your app to a website by the logcat.
You can set that code up like this:
It says you called android.intent.action.VIEW, should be android.intent.action.ACTION_VIEW
After using intent,
Add the new activity to manifest:
See developer docs.
Update to start webpage from intent
Not the answer you’re looking for? Browse other questions tagged android or ask your own question.
Related
Hot Network Questions
Subscribe to RSS
To subscribe to this RSS feed, copy and paste this URL into your RSS reader.
site design / logo © 2021 Stack Exchange Inc; user contributions licensed under cc by-sa. rev 2021.12.16.41042
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.
No Activity found to handle Intent : android.intent.action.VIEW
This is my code to play the recorded audio 3gp file
But while running it in my HTC device (Android 2.2 Froyo) shows an exception:
In Galaxy tablet it’s working fine. How can I resolve this issue?
16 Answers 16
Url addresses must be preceded by http://
throws an ActivityNotFoundException. If you prepend «http://», problem solved.
If you are also getting this error when trying to open a web page from your android app it is because your url looks like this:
instead of: https://www.google.com or http://www.google.com
add this code to your Activity/Fragment:
This is the right way to do it.
you need to import import android.webkit.MimeTypeMap;
For me when trying to open a link :
I got the same error android.content.ActivityNotFoundException: No Activity found to handle Intent
The problem was because i didnt have any app that can open URLs (i.e. browsers) installed in my phone. So after Installing a browser the problem was solved.
*Lesson : Make sure there is at least one app which handles the intent you are calling *
android.content.ActivityNotFoundException using Intent
I am writing an app in which i am trying to send an email with some data, but whenever i do click on Submit button to send an email, getting : Unfortunately App has Stopped
Error:
Code:
Logcat:
3 Answers 3
Few months ago i was facing same problem, and i found a small solution, please try below code by replacing yours
If you will get There are no email applications installed. message, it means your work is done and i will suggest you to check it on real DEVICE, but i also don’t know how to send it via EMULATOR
The Android emulator seems to lack a configured email account. That’s why your code crashes. I’d suggest catching an ActivityNotFoundException when trying to send:
You can get more information on this issue here.
Especially this paragraph is interesting:
If you are using an emulator, you’ll need to configure the email client. If the email client is not configured, it will not respond to the Intent we’ll be discussing. If you want to see the chooser in action, you’ll need to configure a device using multiple messaging applications, such as the Gmail application and the Email application.
Why is no Activity found to handle Intent?
Instead of going the regular getPackageManager().getLaunchIntentForPackage(«com.example.app») way, I want to create the launch intent by myself.
7 Answers 7
I understand that you are trying to start the Launcher activity of a known application with known package name ( com.example.app ). I assume you have information about the application. Thus, you can start it via explicit intent like so:
EDIT: Doing an analysis of the two intent objects ( intent1 == your own intent VS intent2 == intent created from getLaunchIntentForPackage() ), the difference is
I will have to believe that what you have done to create your own intent object is not enough for the explicit intent to work. You will have to provide Android more information about your intent such as being specific with the component name (as shown in my answer above).
You can also check to make sure there is an activity that can receive your broadcast:
startActivity treats all intents as if they declared CATEGORY_DEFAULT
Even if you don’t have intent.addCategory(Intent.CATEGORY_DEFAULT); in your code.
. except if it doesn’t
The system will not look for CATEGORY_DEFAULT if you set the class name of the target activity:
Source of header: the blue note on the element’s page.
Source of the definition of an explicit intent: developer.android.com.
This is the function where android.content.Intent#CATEGORY_DEFAULT is added to all startActivity code.
You asked to see the code executed after startActivity and here it is.
The call on the last line is a remote process call, meaning that in your app process a the method is called on a proxy IActivityManager instance which forwards it to another process, in this case a system process.
Up to this point, no Intent filtering has taken place.
In Android’s system process IActivityManager resolved to ActivityManagerService and:
This is the where MATCH_DEFAULT_ONLY is added, as nkalra0123 said.
All these call method calls then return and eventually some object somewhere will figure out there were no matching IntentFilters. I omit that here because this is the relevant part of the answer.