android-intent

Intent-filter abnormal behavior with samsung file browser

拜拜、爱过 提交于 2020-05-13 14:31:34
问题 I'm creating an intent filter for a specific extension (.infi) for my app. It works correctly with ES file explorer & Solid explorer. However when I open the file with Samsung default file explorer (Device Galaxy Tab S2) it shows a strange message "No application to perform this action", on other device (Note 4) it tries to open the file with Adobe Reader with an error message. Here is my code from manifests file : <activity android:name=".ImportCollections"> <intent-filter> <action android

Open file picker form my Android activity

与世无争的帅哥 提交于 2020-05-11 14:29:48
问题 I'm making an Android app which stores some downloaded pdf files inside the device's SD card. Everything works fine, but now I want to add a function to just pop up the default android file/folder browser showing the directory where my app stores all the PDF (with subdirectories in it) so that the user sees where his documents are stored and can easily browse them. I've been throught many other SO questions and forum posts, but it seems this can only be done for music/images/contacts/etc.

“Rebooting receiver” not working android [Xamarin.Android]

a 夏天 提交于 2020-04-30 12:54:28
问题 I am trying to implement a broadcast receiver that gets the broadcast when the device has been rebooted, but is not working (it is supposed to send me a toast when the device has rebooted) with the following code: Broadcast receiver: [BroadcastReceiver] public class RebootReceiver : BroadcastReceiver { public override void OnReceive(Context context, Intent intent) { if (Intent.ActionBootCompleted.Equals(intent.Action)) { Toast.MakeText( context, "Your app has been rebooted!", ToastLength.Long

Send “share intent” (ACTION_SEND) from activity to service

限于喜欢 提交于 2020-04-30 08:51:20
问题 The task is to process somehow "share" intent in already running service . As far as ACTION_SEND is an activity action we have to pick up intent in activity and broadcast it to service. The problem is that it's logically to implement all "share intent" processing in service and use activity only for broadcasting intent. So the service have to receive the intent (which previously received and broadcasted by activity) so we can call getType() and get****Extra***() to it in order to know what

Invoking intent from a fragment

a 夏天 提交于 2020-04-30 07:37:14
问题 I have a fragment public class TwitterFragment extends Fragment implements OnClickListener {} From this fragment I am invoking an intent as: Intent intent = new Intent(this, WebViewActivity.class); where, public class WebViewActivity extends Activity { But Invoking intent is giving error: Error:(214, 33) error: no suitable constructor found for Intent(TwitterFragment,Class<WebViewActivity>) constructor Intent.Intent(String,Uri) is not applicable (argument mismatch; TwitterFragment cannot be

How to trigger a launch Activity intent when my app is closed on Android 10/Q?

时间秒杀一切 提交于 2020-04-18 03:47:32
问题 I am trying to create an app that will open another app at a specified time. To do this, I used an AlarmManager that starts a service. It works just fine if my app is open when the alarm is triggered. I get a notification that the service started, and the other app opens. However, if my app is in the background (after pressing the home button), and the alarm triggers, I get a notification that the service started, but the other app does not launch. What am I doing wrong? I am testing this on

TransactionTooLargeException even when file size is super small

故事扮演 提交于 2020-04-16 03:28:46
问题 I keep getting this error when trying share an image file: java.lang.RuntimeException: android.os.TransactionTooLargeException: data parcel size 1085992 bytes I assumed a fix for this would be to compress the image even more and that would lessen the size. Here's the function that does this job: public static File saveBitmaptoFile(Bitmap bitmap, File pictureFile) { FileOutputStream out = null; try { out = new FileOutputStream(pictureFile); // on the next line I'm trying compress the heck out

TransactionTooLargeException even when file size is super small

隐身守侯 提交于 2020-04-16 03:27:59
问题 I keep getting this error when trying share an image file: java.lang.RuntimeException: android.os.TransactionTooLargeException: data parcel size 1085992 bytes I assumed a fix for this would be to compress the image even more and that would lessen the size. Here's the function that does this job: public static File saveBitmaptoFile(Bitmap bitmap, File pictureFile) { FileOutputStream out = null; try { out = new FileOutputStream(pictureFile); // on the next line I'm trying compress the heck out

Full screen intent not starting the activity but do show a notification on android 10

有些话、适合烂在心里 提交于 2020-04-10 03:21:18
问题 I try to launch activity for a broadcastReceiver by using the next code Intent i = new Intent(context, AlarmNotification.class); i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { // This is at least android 10... NotificationManager mgr = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); if (mgr.getNotificationChannel(CHANNEL_WHATEVER)==null) { mgr.createNotificationChannel(new

Share intent issue in Instagram feed

核能气质少年 提交于 2020-04-07 11:37:27
问题 I have an app that shares images from url. Last android update, I got message from instagram "Unable to load image" when I want to share an image in instagram feed. But i can share image story, direct message, and everywhere... I am having this issue only instagram feed. public void onShareItemOreo() { // Get access to bitmap image from view imageView = (ImageView) findViewById(R.id.thumbnail); // Get access to the URI for the bitmap Uri bmpUri = prepareShareIntent(imageView); if (bmpUri !=