android-intent

Send Image and Text both using ACTION_SEND or ACTION_SEND_MULTIPLE

此生再无相见时 提交于 2020-01-14 12:21:33
问题 - We have tried to post image and text using the below code: final Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND_MULTIPLE); shareIntent.setType("image/png"); shareIntent.putExtra(android.content.Intent.EXTRA_STREAM, Uri.parse("file:///mnt/sdcard/UserImages/"+ ParseUser.getCurrentUser().getObjectId() + ".png")); shareIntent.putExtra(android.content.Intent.EXTRA_TEXT,"Hello test"); startActivity(Intent.createChooser(shareIntent,"Share")); - We have also tried using

Send Image and Text both using ACTION_SEND or ACTION_SEND_MULTIPLE

房东的猫 提交于 2020-01-14 12:21:11
问题 - We have tried to post image and text using the below code: final Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND_MULTIPLE); shareIntent.setType("image/png"); shareIntent.putExtra(android.content.Intent.EXTRA_STREAM, Uri.parse("file:///mnt/sdcard/UserImages/"+ ParseUser.getCurrentUser().getObjectId() + ".png")); shareIntent.putExtra(android.content.Intent.EXTRA_TEXT,"Hello test"); startActivity(Intent.createChooser(shareIntent,"Share")); - We have also tried using

How do I let the user choose a location in Google Maps and return the chosen point to my App Inventor application?

六眼飞鱼酱① 提交于 2020-01-14 10:44:17
问题 I am developing an app using App Inventor. It includes the need for a user to press a button - to save a location when they are at the location. But every time this is not practical. So I want to implement a method in my App Inventor app which will: -Open Google Maps -Let the user select any point on the map with no additional info. -After choosing, return to the app and return latitude, longitude values for the location that is selected. This is really important for me, help will be

“java.lang.RuntimeException: Could not launch intent” for UI with indeterminate ProgressBar

半世苍凉 提交于 2020-01-14 10:33:16
问题 Are there any known issues with displaying indeterminate ProgressBar s with the AndroidJUnitRunner? I'm hitting this error during tests: 05-26 15:22:48.504 1003-1016/? I/TestRunner﹕ java.lang.RuntimeException: Could not launch intent Intent { act=android.intent.action.MAIN flg=0x14000000 cmp=com.cookbrite.dev/com.cookbrite.ui.HomeListActivity } within 45 seconds. Perhaps the main thread has not gone idle within a reasonable amount of time? There could be an animation or something constantly

how to handle keep alive connection in android Service

情到浓时终转凉″ 提交于 2020-01-14 09:00:10
问题 I am using asmack for an android IM application, where I am using remote service with AIDL interface. Inside of onStartCommand method of my service I write code as below. I create connection and then login using that. When anyone run my application inside onCreate method of main activity of my application run my service getApplicationContext.StartService(serviceIntent) . It's working fine, but after few minutes (sometimes 10 minutes and some time more than ten) messageListener that I attach

How to get Intent from PendingIntent

[亡魂溺海] 提交于 2020-01-14 07:02:42
问题 Can I get the Intent from a PendingIntent ? Here is the scenario: I create an Intent (let's call it myIntent ) I put some Extra information with a String (call it myInfo ) I create a PendingIntent ( myPendingIntent ) using myIntent I set an alarm using the AlarmManager and myPendingIntent At a later stage I get hold of the PendingIntent using PendingIntent.getBroadcast At that point I want to read myInfo from myIntent which is in myPendingIntent Is this possible? By looking around Google, I

how can I send a List into another activity in Android Studio

早过忘川 提交于 2020-01-14 06:57:09
问题 I know that I can add a string or an integer by putting putextra() on my Intent but what do I do if I have to send a List? For example, My main activity contains a list, I have a different activity that adds an item into the list and I have a third activity that needs to show the whole list 回答1: Your object can also implement Parcelable interface. Then you can use Bundle.putParcelable() method and pass your object between activities within intent. Photostream application uses this approach

Wifi Broadcastreceiver onreceive

孤街浪徒 提交于 2020-01-14 04:10:10
问题 I have problems with the wifi broadcast receiver. It doesn't receive anything, onReceive is never called. Here's my code: public final class WifiChangeReceiver extends BroadcastReceiver { boolean portableHotspot = true; @Override public void onReceive(final Context context, Intent intent) { boolean alreadyPresent = false; String action = intent.getAction(); if(action.equals(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION)) { WifiManager w = (WifiManager) context .getSystemService(Context.WIFI

how to send images to gallery for setting the wallpaper?

狂风中的少年 提交于 2020-01-14 03:38:08
问题 i was trying to integrate set as wallpaper option using default gallery app, I don't know how to send the image to gallery using intent. I am attaching fb app samples how its look like. String root = Environment.getExternalStorageDirectory().toString(); new File(root + "/"+Constants1.APPNAME).mkdirs(); File fileForImage = new File(root + "/"+Constants1.APPNAME, pos + ".jpg"); if (fileForImage.exists()) fileForImage.delete(); try { FileOutputStream out = new FileOutputStream(fileForImage);

Contact picker that shows number, contact name and possibly a contact image?

ぐ巨炮叔叔 提交于 2020-01-14 02:53:05
问题 Is there any way to display contact picker that has both number and contact name? Now I'm calling picker: startActivityForResult( new Intent(Intent.ACTION_PICK,Contacts.Phones.CONTENT_URI), 1); But in a result I get only Contact names without visible numbers. To make things worse, if one contact has two numbers it occurs twice. 回答1: try this. its just like the contact picker, but lists clickable phone numbers under the contacts name Intent intent = new Intent(Intent.ACTION_PICK, Contacts