android-intent

File not found exception (Path from URI)

Deadly 提交于 2019-12-22 04:45:22
问题 I'm trying to get a FileInputStream object for the picture a user selects from their gallery and when I'm trying to open the file from the URI I receive, it keeps saying FileNotFoundException ... Here's the code I'm using to fire off the intent for picking an image from the gallery: Intent intent = new Intent(); intent.setType("image/*"); intent.setAction(Intent.ACTION_GET_CONTENT); startActivityForResult(Intent.createChooser(intent, "Select Picture"), PICK_IMAGE_REQUEST); And here's the code

Permanently modify Intent that started an Activity

时光毁灭记忆、已成空白 提交于 2019-12-22 04:06:23
问题 I would like send an Intent to start an Activity. I would like to be able to modify that Intent. Then, when the activity is destroyed and recreated, I would like those modifications to still be present when I call getIntent() . Currently, modifying the intent works fine as long as the Activity has not been destroyed. If it has, then when the activity is recreated, it will get the original Intent that started it, and not the copy it received when it was launched the first time that may have

Select File from file manager via Intent

萝らか妹 提交于 2019-12-22 04:05:34
问题 What I wanna do: I wanna get the path as a String of a file, which I choose via an Android File Manager. What I have: Intent intent = new Intent(Intent.ACTION_GET_CONTENT); intent.setType("*/*"); startActivityForResult(Intent.createChooser(intent, "Open with ..."), FILE_SELECT_CODE); This code, works nearly fine for me, but there is one problem. I can only select my file with the following apps: My Question: Does anyone have a working code for choosing any file via the Android File Manager?

Use Android share intent in Javascript in Chrome?

回眸只為那壹抹淺笑 提交于 2019-12-22 03:54:28
问题 I would like to bring up the Android Share menu from Javascript in Chrome for Android. I know that you can launch a specific app from Chrome: https://developers.google.com/chrome/mobile/docs/intents Is there a way to use href="intent://..." to open the Share menu? This is how it is done in an app: http://developer.android.com/training/sharing/shareaction.html 回答1: The quick answer is you can't. I made this sample: http://jsbin.com/AdAPEmu/2 which constructs the Intent as it would appear for

Put Object as intent for next activity

北城以北 提交于 2019-12-22 03:52:59
问题 Is it possible to to put an object of type Object into an intent as a Extra? I have a variable of type object and won't know until it is assigned a value as to what the object datatype is. Maybe something to do with serialization or as a bundle i'm not sure? And then in the next activity how do I then get this value in order to store it in an ArrayList<Object> ? 回答1: Bundle by way of Intent#putExtra does not have any function to add an Object . You can only pass in a Parcelable or a

How to debug android application built with maven

安稳与你 提交于 2019-12-22 03:52:24
问题 I'm currently trying to debug android application on my device from eclipse. Device has been added I can see it both in console and in eclipse. Console (Windows) : adb devices List of devices attached 0019cca27f2e6e device And the eclipse : I can run the app without any issues on both device/simulator. I just do clean install and android:deploy followed by android:run and works like a charm. But I can't figure out yet how to debug it. But when I actually run the app on the device(Samsung

Incorrect extras received with all intents but the first one

孤者浪人 提交于 2019-12-22 03:45:17
问题 I have a small application which can be used to set reminders for future events. The app uses an AlarmManager to set the time for when the user should be reminded. When the alarm goes off, a BroadcastReceiver registers this and in turn starts a service to notify the user via a toast and a notification in the status bar. In order to display the correct information in the notification and toast, some extra information is passed along with the intent. The first time a reminder is registered, the

Incorrect extras received with all intents but the first one

强颜欢笑 提交于 2019-12-22 03:45:07
问题 I have a small application which can be used to set reminders for future events. The app uses an AlarmManager to set the time for when the user should be reminded. When the alarm goes off, a BroadcastReceiver registers this and in turn starts a service to notify the user via a toast and a notification in the status bar. In order to display the correct information in the notification and toast, some extra information is passed along with the intent. The first time a reminder is registered, the

List of default apps showing wrong in Android L

允我心安 提交于 2019-12-22 03:37:29
问题 I want to get all default apps in Android L. I used bellow code but they give me a wrong solution. Let see my code first private void getMyAppLauncherDefault() { final IntentFilter filter = new IntentFilter(Intent.ACTION_MAIN); filter.addCategory(Intent.CATEGORY_HOME); List<IntentFilter> filters = new ArrayList<IntentFilter>(); filters.add(filter); List<ComponentName> activities = new ArrayList<ComponentName>(); final PackageManager packageManager = (PackageManager) getPackageManager();

List of default apps showing wrong in Android L

こ雲淡風輕ζ 提交于 2019-12-22 03:36:28
问题 I want to get all default apps in Android L. I used bellow code but they give me a wrong solution. Let see my code first private void getMyAppLauncherDefault() { final IntentFilter filter = new IntentFilter(Intent.ACTION_MAIN); filter.addCategory(Intent.CATEGORY_HOME); List<IntentFilter> filters = new ArrayList<IntentFilter>(); filters.add(filter); List<ComponentName> activities = new ArrayList<ComponentName>(); final PackageManager packageManager = (PackageManager) getPackageManager();