intent

Gmail 5.0 app fails with “Permission denied for the attachment” when it receives ACTION_SEND intent

匿名 (未验证) 提交于 2019-12-03 02:52:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: My app creates mails with attachments, and uses an intent with Intent.ACTION_SEND to launch a mail app. It works with all the mail apps I tested with, except for the new Gmail 5.0 (it works with Gmail 4.9), where the mail opens without attachment, showing the error: "Permission denied for the attachment". There are no useful messages from Gmail on logcat. I only tested Gmail 5.0 on Android KitKat, but on multiple devices. I create the file for the attachment like this: String fileName = "file-name_something_like_this" ;

Android Deep Linking with custom URI

匿名 (未验证) 提交于 2019-12-03 02:52:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have the following defined in my manifest: <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.app.package"> ... <activity android:name="app.myActivity" android:label="@string/app_name" android:screenOrientation="portrait"> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:host="www.example.com" android:pathPrefix="/gizmos" android:scheme="http" /> <!-- note

onActivityResult returns with data = null

匿名 (未验证) 提交于 2019-12-03 02:52:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Ok so this here is the intent I am sending Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); fileUri = getOutputMediaFileUri(MEDIA_TYPE_IMAGE); // create a file to save the image intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri); // set the image file name startActivityForResult(intent, REQUEST_CODE); And then in the onActivityResult I am doing this: protected void onActivityResult(int requestCode, int resultCode, Intent data) { Log.i("Intent name:",data.toString()); if (requestCode == REQUEST_CODE){ if (resultCode == Activity

AppWidgetManager.getAppWidgetIds in activity returns an empty list

匿名 (未验证) 提交于 2019-12-03 02:50:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have an appwidget that I'm trying to update from an activity. To do that, I need the appwidget id. I've used AppWidgetManager.getAppWidgetIds but it always returns an empty list. I also used AppWidgetManager.getInstalledProviders to make sure that my ComponentName is correct, but still I get an empty list. I've seen all the other questions about this, but I couldn't find something that worked for me. Is there another way to solve this? or another way to update the widget? My code: ComponentName name = new ComponentName(packageName,

Android - file provider - permission denial

匿名 (未验证) 提交于 2019-12-03 02:49:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have two apps : app1 and app2. App2 has : paths.xml : App2 receives request in its Activity from App1 to get URI for an image. The App2 Activity does the following once URI is decided : Intent intent = new Intent (); intent . setDataAndType ( contentUri , getContentResolver (). getType ( contentUri )); int uid = Binder . getCallingUid (); String callingPackage = getPackageManager (). getNameForUid ( uid ); getApplicationContext (). grantUriPermission ( callingPackage , contentUri , Intent . FLAG_GRANT_READ_URI_PERMISSION );

java.lang.SecurityException: Permission Denial: not allowed to send broadcast android.intent.action.MEDIA_MOUNTED on KitKat only

匿名 (未验证) 提交于 2019-12-03 02:49:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using the DownloadManager to download images off our server and I am placing the files in the externalFilesDir . I am send out a broadcast intent because I don't want these downloaded images to appear in the gallery. sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse("file://" + context.getExternalFilesDir(null)))); I only tested this on my Galaxy S3 Jelly Bean 4.3 prior and it was working, but when I tested it on KitKat 4.4 it crashes the app. Is there a better way to not have the files downloaded from the DownloadManager

How to Crop Images without using Intent in Android

匿名 (未验证) 提交于 2019-12-03 02:49:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to crop an image I have used the code below Intent i = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI); i.putExtra("crop", "true"); startActivityForResult(i, 1); But i have to do crop image without using Intent. And also have to customize the croping UI. please help me out how to do that. I am not supposed to use new Intent("com.android.camera.action.CROP"); with Thanks Vikash 回答1: Here is a sample project that Works same like Default Crop Intent of Android. CropImage If you really

Open telegram channel in android

匿名 (未验证) 提交于 2019-12-03 02:48:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: In my app want to use Intent to open specific telegram channel or telegram group. i search in SF but i can't find anything.i try to implement but i only can open all messenger apps that user can choose but not telegram or specific telegram group or channel. if find this on sf but it's not answer to my question. Intent myIntent = new Intent(Intent.ACTION_SEND); myIntent.setType("text/plain"); myIntent.setPackage(appName); myIntent.putExtra(Intent.EXTRA_TEXT, msg);// mUIActivity.startActivity(Intent.createChooser(myIntent, "Share with")); 回答1:

Removing extras from passed-in Intent

匿名 (未验证) 提交于 2019-12-03 02:47:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a search screen which can be launched from clicking on a "name" field of another screen. If the user follows this workflow, I add an extra to the Intent's Extras called "search". This extra uses the text populating the "name" field as its value. When the search screen is created, that extra is used as a search parameter and a search is automatically launched for the user. However, since Android destroys and recreates Activitys when the screen rotates, rotating the phone causes an auto-search again. Because of this, I'd like to remove

Parcelable encountered IOException writing serializable object getactivity()

匿名 (未验证) 提交于 2019-12-03 02:47:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: so I am getting this in logcat: java.lang.RuntimeException: Parcelable encountered IOException writing serializable object (name = com.resources.student_list.Student) I know this means that my student class is not serializable, but it is, here is my student class: import java.io.Serializable; public class Student implements Comparable , Serializable{ private static final long serialVersionUID = 1L; private String firstName, lastName; private DSLL gradeList; public Student() { firstName = ""; lastName = ""; gradeList = new DSLL (); } public