android-intent

Read Android intent extra data on Unity app launch

只愿长相守 提交于 2019-12-29 03:33:08
问题 I am launching an Unity application from another Android application using a custom implicit intent. This is working fine, but I cannot figure out how to read the intent extra data in Unity? ANDROID INTENT TO LAUNCH UNITY APP i=new Intent(); i.setAction("com.company.unityapp.MyMethod"); i.putExtra("KEY","This is the message string"); startActivity(i); UNITY APP AndroidManifest.xml <intent-filter> <action android:name="com.company.unityapp.MyMethod" /> <category android:name="android.intent

Sharing an image with Google+ app using Intent.ACTION_SEND and Intent.EXTRA_STREAM

回眸只為那壹抹淺笑 提交于 2019-12-29 03:12:05
问题 My app generates images that a user can save or share with others. The code below works for most apps: Messenger, Facebook, Dropbox, email, etc. Meaning, the image is loaded by the chosen app, and a user can share the image successfully with that app. Intent intent = new Intent(Intent.ACTION_SEND); intent.setType("image/png"); File o = new File(dir, "file.png"); intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(o)); startActivity(Intent.createChooser(intent , "Send options")); However, when I

OnActivityResult not getting called in Fragment where intent pass from adapter class

眉间皱痕 提交于 2019-12-29 02:11:06
问题 So in my adapter class, I would like to allow user to capture image fun dispatchTakePictureIntent() { try { val captureIntent = Intent(MediaStore.ACTION_IMAGE_CAPTURE); (context as Activity).startActivityForResult(captureIntent, 1) } catch (e: ActivityNotFoundException) { e.printStackTrace() } } fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent) { Log.d("MyAdapter", "onActivityResult") } I want the onActivityResult in a fragment class get called, but it doesn't. override

photo share intent in android

◇◆丶佛笑我妖孽 提交于 2019-12-29 01:51:06
问题 Intent shareIntent = new Intent(Intent.ACTION_SEND); shareIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); shareIntent.setType("image/*"); Uri uri = Uri.parse(pathToImage); shareIntent.putExtra(Intent.EXTRA_STREAM, uri); return shareIntent; i was used above code for sharing image on social sites.when i posting image on facebook only text is posted and image is not coming.how can we get the image and pathtoimage is string variable i am getting sever image path and stored in string

open camera using intent

纵然是瞬间 提交于 2019-12-29 01:35:11
问题 I want to use intent to open camera in Android . I used the following code but when i press the button (whose action is onclick() function the app closes on itself . public void onclick(int actionCode){ Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(takePictureIntent, actionCode); } public static boolean isIntentAvailable(Context context, String action) { final PackageManager packageManager = context.getPackageManager(); final Intent intent =

How to access gmail attachment data in my app

跟風遠走 提交于 2019-12-28 18:08:01
问题 I have an app that uses a specifically created binary (.gcsb) file type. These files are kept in a folder on the sdcard. At the moment they are moved on and off using ES file explorer or the phone manufacturer 'behave like a USB drive' transfer utilities. Clunky. What I want to to is be able to email the files to the phone, then to open the files as attachments from within gmail, which should fire up the app, which will then save them to the appropriate SD card folder. I've found some stuff

Passing ArrayList<MyObject> Between multiple Activities

北战南征 提交于 2019-12-28 15:37:02
问题 I am trying to pass an ArrayList of Objects between multiple activities in my application. Is it possible to do this using an Intent using the setData() method? 回答1: If you want to send an ArrayList of objects then your class must implement the Parcelable or Serializable interface . See these good tutorials for sending custom object between Activities http://androidideasblog.blogspot.in/2010/02/passing-list-of-objects-between.html http://www.anddev.org/novice-tutorials-f8/simple-tutorial

Passing ArrayList<MyObject> Between multiple Activities

半腔热情 提交于 2019-12-28 15:36:32
问题 I am trying to pass an ArrayList of Objects between multiple activities in my application. Is it possible to do this using an Intent using the setData() method? 回答1: If you want to send an ArrayList of objects then your class must implement the Parcelable or Serializable interface . See these good tutorials for sending custom object between Activities http://androidideasblog.blogspot.in/2010/02/passing-list-of-objects-between.html http://www.anddev.org/novice-tutorials-f8/simple-tutorial

Passing ArrayList<MyObject> Between multiple Activities

梦想的初衷 提交于 2019-12-28 15:36:26
问题 I am trying to pass an ArrayList of Objects between multiple activities in my application. Is it possible to do this using an Intent using the setData() method? 回答1: If you want to send an ArrayList of objects then your class must implement the Parcelable or Serializable interface . See these good tutorials for sending custom object between Activities http://androidideasblog.blogspot.in/2010/02/passing-list-of-objects-between.html http://www.anddev.org/novice-tutorials-f8/simple-tutorial

Skip going back to direct parent activity when pressed back

廉价感情. 提交于 2019-12-28 13:57:52
问题 I have got a small problem in an Android app I am working on : There are 3 activities namely A , B , C and the invocation is in the following order : A -> B -> C. While in C, when I press BACK button, it should go back to A[Instead of the B by default]. And pressing BACK in A will exit the program. I tried to call an intent from C to A. But in this case the call invocation gets into a loop : A -> B -> C -> A since the new activity is pushed on top of the stack. As a result, when BACK is