android-intent

Is it possible to share an image on Android via a data URL?

谁都会走 提交于 2019-12-23 12:18:34
问题 Is it possible to share an image with code something like this? Intent share = new Intent(Intent.ACTION_SEND); share.setData(Uri.parse("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACx" + "jwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGoSURBVDhPlVM9SEJRGD2DkL+QmoiKYNggToJL" + "4KKLNDiKW4NCoENQkzS1uboILoKjW61NSZOjo1uOBlHPgjJsuN3jvc+naVQHPt79vu+cc9/37n34" + "BQkd/0Jibw+3Ozt4j0TwwuCaNfYU5Qe43Tg5OMDD9TWEYUAIoYJr1mIxPEmjc01fh8uF03wer6vC" +

Multiple Intent receivers?

♀尐吖头ヾ 提交于 2019-12-23 12:16:58
问题 Documentation states that if an Intent can be processed by multiple applications the user will be prompted with a dialog asking him to choose the application to complete the action. Is there any way to make user select multiple applications that will complete the action one by one? For example, if I want to share a message I'll be using ACTION_SEND with a specified MIME type and I'll be prompted with a list of applications that can share the message. Can I make a user choose multiple apps to

Google Chrome does not open application on Deep Link on Android

痞子三分冷 提交于 2019-12-23 12:13:13
问题 Google Chrome wouldn't launch my app on Deep Link, however, the app gets launched if I run it from Firefox. I use "onkat://" just as an example as I just want to get the app launched first. Following is the code in my AndroidManifest.xml <activity android:name="MainActivity" android:configChanges="keyboardHidden|screenSize|orientation" android:icon="@drawable/something" android:label="@string/appName" android:launchMode="singleTask" android:screenOrientation="user" > <intent-filter> <action

App crashes on making a new intent. NoClassDefFoundError

北慕城南 提交于 2019-12-23 12:07:59
问题 I am trying to navigate to a fragmentactivity with a button click but my app crashes on the line it creates the intent. Can anyone help me figure out why? The activity I am navigating too is in the same package and I believe it is correctly recorded in the manifest. Here is my manifest <?xml version="1.0" encoding="utf-8" standalone="no"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.indigohate" android:versionCode="1" android:versionName="1.0" > <uses-sdk

How to discover another app's intent

五迷三道 提交于 2019-12-23 12:00:41
问题 I'm trying to build an app to receive shares from the StumbleUpon app. I can, at this point, receive the browser's "share url", but when sharing from StumbleUpon my app does not show up on the list. I'm thinking that I may not have registered the correct Intents in the manifest. Is there any way to find what that app is doing? Thanks. 回答1: You can get a bit of information about intents from logcat. When I shared in StumbleUpon I noticed this in the log: 12-08 19:01:18.915: I/ActivityManager

Show Toast after email send in android?

回眸只為那壹抹淺笑 提交于 2019-12-23 11:22:44
问题 I am using the below code to send the mail Intent i = new Intent(Intent.ACTION_SEND); i.setType("text/plain"); i.putExtra(Intent.EXTRA_EMAIL, new String[] { "abc@yahoo.com" }); i.putExtra(Intent.EXTRA_CC, new String[] { bcc_string }); i.putExtra(Intent.EXTRA_SUBJECT, "Video Suggest"); i.putExtra(Intent.EXTRA_TEXT, url_link); try { startActivityForResult(Intent.createChooser(i, "Send Mail..."), 1); } catch (android.content.ActivityNotFoundException ex) { Toast.makeText(AllVideos.this, "There

Android IntentService triggered with null intent

浪尽此生 提交于 2019-12-23 10:49:11
问题 I'm seeing a crash in Crashlytics: Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.content.Intent.getIntExtra(java.lang.String, int)' on a null object reference at com.myapp.APKOfferQueueManagerIntentService.onHandleIntent(SourceFile:71) at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.os.HandlerThread.run

Set activity launch mode programmatically

痴心易碎 提交于 2019-12-23 10:19:38
问题 I need to call activity with different launchMode according to my app state. In one case it should be singleInstance , in other - singleTask . I know how to set launchMode in AndroidManifest , but since it should be dynamic property I have to do it from code. I thought, that I can add some specific flag to intent, before starting activity, but I found only singleTop flag. So is any way to solve this issue? Thanks 回答1: After some investigations I've noticed that it is impossible to do that in

Trying to access sub folders in assets folder

自闭症网瘾萝莉.ら 提交于 2019-12-23 10:14:09
问题 my assets folder has a tree of sub folders.. i am trying to access a pdf in that directory .. the url is as follows url = QP/28/28/mth.pdf the complete directory is as follows ful directory = file:///data/data/com.example.testqstn/files/QP/28/28/mth.pdf i have accessed the path using the following code intent.setDataAndType(Uri.parse("file://" + getApplicationContext().getFilesDir() + "/"+url), "application/pdf"); startActivity(intent); finish(); i am not getting any error msgs but the pdf is

Intent shows a blank image

本秂侑毒 提交于 2019-12-23 09:58:08
问题 When i try to open an image on the gallery (I'm developing a file manager) using intent, the image shown is totally black., but I can't understand why, as I've also followed the last best practices by google about getting the Uri (with FileProvider). MainActivity.java Intent intent=new Intent(); intent.setAction(Intent.ACTION_VIEW); Uri uri=FileProvider.getUriForFile(MainActivity.this,BuildConfig.APPLICATION_ID + ".provider",image); intent.setDataAndType(uri,MimeTypeMap.getSingleton()