android-intent

Calling an extrenal application

走远了吗. 提交于 2020-01-24 10:49:49
问题 How can I call an external application from my application? E.g: I need to call Shazam (application) from my app. I can see the package name of the application in the logcat . will that be useful for any purpose? 回答1: You can call a third party application's activity in the following way. final Intent shazamIntent = new Intent("com.shazam.android"); shazamIntent .setComponent(new ComponentName("com.shazam.android","com.shazam.android.Splash")); startActivity(shazamIntent ); But, this is not a

Kotiln: pass data from adapter to activity

微笑、不失礼 提交于 2020-01-24 10:32:20
问题 I try to pass my data from the adapter to my other activity with a putExtra but when I click on an item in my list to move to my second activity , no data is retrieved and the default text I put in is not displayed. another way to do? or What do I miss about it? Here my code : My onBindViewHolder : override fun onBindViewHolder(holder: AlbumsListViewHolder, position: Int) { val AlbumsData = albumsData!![position] holder.albumsName.text = AlbumsData.title Glide.with(holder.itemView) .load

SDK manager does not show sample package option

こ雲淡風輕ζ 提交于 2020-01-24 08:43:27
问题 I followed the android developer link to install sample package. However, when I expand the package list of Android platform, there is no " Sample for SDK " option (checkbox) available. Why?? I have installed Android from version 2.3.3(API10) to 4.0.3(API 15), none of them contain the option for downloading sample package. Why? Anyone has the same problem? 回答1: //you need to download it there is an option for that. if it show already installed you need to go to the folder called <sdk>/samples

Android Camera no save in specific folder [MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA]

不问归期 提交于 2020-01-24 05:38:31
问题 I'm a problem when I using the MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA in the Intent. The camera starts correctly but it doesn't save the files in my specific folder "/photo". But when I use the MediaStore.ACTION_IMAGE_CAPTURE it works fine, but I can't use this because it take only one photo each time. I need the camera starts and the user takes many photos. After he closes the camera and all photos are saved in my specific folder. Thanks for your help. Regards, Marcelo Source code:

GPS stays on using Intent call

纵饮孤独 提交于 2020-01-24 00:48:18
问题 I have a quick behavior question. When I call the following lines of code: String currURL = "http://maps.google.com/maps?saddr="+nLocation.getLatitude()+","+nLocation.getLongitude()+"&daddr=110+Possum+Hollow+Road,+Newark,+DE+19711+(Tri-State+Bird+Rescue)&hl=en&ll=AnotherLat,AnotherLong&spn=0.28323,0.683212&sll=AnotherLat,AnotherLong&sspn=0.283147,0.683212&geocode=FcejYQIdRnCE-w%3BFXn_XQIda4F8-yF_tbhhHBmAIw&vpsrc=0&mra=pd&z=11"; Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse

How open a page on facebook lite app

早过忘川 提交于 2020-01-23 22:08:15
问题 I'm trying to create a Visit us on facebook thing, I want to rather open the page on facebook app (if the user have it) if don't then open on normal browser. This is my code based in @Jared Rummler answer private void showPage(String url) { Uri uri = Uri.parse(url); try { ApplicationInfo applicationInfo = getPackageManager().getApplicationInfo("com.facebook.katana", 0); if (applicationInfo.enabled) { uri = Uri.parse("fb://facewebmodal/f?href=" + url); } } catch (PackageManager

How open a page on facebook lite app

心已入冬 提交于 2020-01-23 22:07:41
问题 I'm trying to create a Visit us on facebook thing, I want to rather open the page on facebook app (if the user have it) if don't then open on normal browser. This is my code based in @Jared Rummler answer private void showPage(String url) { Uri uri = Uri.parse(url); try { ApplicationInfo applicationInfo = getPackageManager().getApplicationInfo("com.facebook.katana", 0); if (applicationInfo.enabled) { uri = Uri.parse("fb://facewebmodal/f?href=" + url); } } catch (PackageManager

Android Studio get File from Gallery Intent

烂漫一生 提交于 2020-01-23 18:26:33
问题 Short answer is it possible to get original file from Gallery request,and if it possible how can i do it? This code doesn't work for me. Uri uri = data.getData(); File file = new File(uri.getPath()); And the long Answer)): I use this code to make gallery intent addGallery.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(Intent.ACTION_PICK); intent.setType("image/*"); startActivityForResult(intent, GALLERY_IMAGE_REQUEST); } });

Android Studio get File from Gallery Intent

故事扮演 提交于 2020-01-23 18:25:32
问题 Short answer is it possible to get original file from Gallery request,and if it possible how can i do it? This code doesn't work for me. Uri uri = data.getData(); File file = new File(uri.getPath()); And the long Answer)): I use this code to make gallery intent addGallery.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(Intent.ACTION_PICK); intent.setType("image/*"); startActivityForResult(intent, GALLERY_IMAGE_REQUEST); } });

Android Studio mailto Intent doesn't show subject and mail body

天涯浪子 提交于 2020-01-23 12:29:12
问题 I'm trying to send an e-mail from my Android App. With the click on a button, gmail should open and show a new email with my previously defined recipient, subject and email body. So far I've tried sending the Intent.ACTION_VIEW as well as Intent.ACTION_SENDTO. Both show my draft with the recipient only. Both subject and message are being opressed. Weird thing is when using the emulator, it works just fine. Also was trying to lock at the android errorlog. Seems like i don't have permission. Is