android-intent

transfer bitmap between two activities in Kotlin

五迷三道 提交于 2020-07-23 06:54:06
问题 There are some answers using java in stackoverflow but i am unable to convert it into kotlin code. I am new to kotlin. Please tell me how to transfer bitmap data from one activity to another using Intent 回答1: You need to pass the bitmap as an extra argument to the intent while starting the activity. val intent = new Intent(this, NewActivity::class.java) intent.putExtra("BitmapImage", bitmap) startActivity(intent); and retrieve it as: val bitmap = this.intent?.getParcelableExtra("BitmapImage")

How to make multiple Deep Linking in two different activity without duplicate the app android

我的梦境 提交于 2020-07-23 06:22:19
问题 I am using deep linking to share my active link to different applications like WhatsApp. The problem is I want to share 2 different activities. Now I am able to share them but if we assume I will share activity A. After clicking on the link, I will see my application option well that's fine and it will take me to activity A. But now if I do share to activity B.When I try to click on the link, my application will appear twice at one time, and if I choose what was previously chosen by activity

How to make multiple Deep Linking in two different activity without duplicate the app android

瘦欲@ 提交于 2020-07-23 06:21:00
问题 I am using deep linking to share my active link to different applications like WhatsApp. The problem is I want to share 2 different activities. Now I am able to share them but if we assume I will share activity A. After clicking on the link, I will see my application option well that's fine and it will take me to activity A. But now if I do share to activity B.When I try to click on the link, my application will appear twice at one time, and if I choose what was previously chosen by activity

Service Intent Must Be Explict

一笑奈何 提交于 2020-07-22 05:47:10
问题 I am trying to launch a service with a predefined action but i get the following error: java.lang.IllegalArgumentException: Service Intent must be explicit: Intent { act=com.radioafrica.music.action.TOGGLE_PLAYBACK } at android.app.ContextImpl.validateServiceIntent(ContextImpl.java:1745) at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1774) at android.app.ContextImpl.startService(ContextImpl.java:1758) at android.content.ContextWrapper.startService(ContextWrapper.java:515) at

What exactly is intent.resolveActivity(getPackageManager()) doing?

青春壹個敷衍的年華 提交于 2020-07-21 04:20:07
问题 I'm going through the the Android Developer Tutorials and I encountered a line of code that I do not understand. This is the line of code (found on 4th page of the Android Developer tutorials.) Intent intent = new Intent(Intent.ACTION_VIEW, webpage); if (intent.resolveActivity(getPackageManager()) != null) { startActivity(intent); } I have a couple of questions. 1) Intent.ACTION_VIEW documentation says that it simply displays data to the user. I understand that the app it chooses will depend

Launching Android Browser in Full Screen Mode from App

◇◆丶佛笑我妖孽 提交于 2020-07-19 10:12:53
问题 Is there a way to launch the android browser from an app in Full Screen Mode such that the address bar is not visible? Any examples or guidance would be much appreciated. 回答1: Depending on your requirements, a WebView might be sufficient. Tutorial can be found here. 回答2: You can simply set full screen mode by First approach: just add to your Manifest.xml android:theme="@android:style/Theme.NoTitleBar.Fullscreen" Second approach: requestWindowFeature(Window.FEATURE_NO_TITLE) Third approach:

How to open Android Outlook application from an external one

痞子三分冷 提交于 2020-07-18 05:27:17
问题 I'm currently developing an Android application in order to display home screen widgets. Those ones are related to Microsoft Outlook (Events + Messages) in order to show incoming events and unread new messages in a kind of dynamic tiles. The Msal graph library helps me a lot to authenticate and retrieve in formations which contains an identifier for each event / message results But now I want to know if the outlook application is installed on the user device and if there is a way to open

How to open Android Outlook application from an external one

可紊 提交于 2020-07-18 05:25:59
问题 I'm currently developing an Android application in order to display home screen widgets. Those ones are related to Microsoft Outlook (Events + Messages) in order to show incoming events and unread new messages in a kind of dynamic tiles. The Msal graph library helps me a lot to authenticate and retrieve in formations which contains an identifier for each event / message results But now I want to know if the outlook application is installed on the user device and if there is a way to open

No persistable permission grants found for URI

倖福魔咒の 提交于 2020-07-17 11:16:26
问题 I'm using the intent action ACTION_GET_CONTENT . Intent intent = new Intent(Intent.ACTION_GET_CONTENT); intent.setType("image/*"); startActivityForResult(i, 3); I need to use the URI in onActivityResult for copying the image that a user chooses and compress the copied image. But I'm getting this error even after taking uri permission using takePersistableUriPermission(uri, Intent.FLAG_GRANT_READ_URI_PERMISSION) in onActivityResult. This works well when I use the Intent action ACTION_OPEN

Starting a Service throws an IllegalAccessException

心不动则不痛 提交于 2020-07-16 05:30:34
问题 I have a Service which takes in an audio file and plays it with MediaPlayer . This is how I call my Service : private void playAudio(String url) throws Exception { Intent music = new Intent(this,MusicService.class); music.putExtra("paths", path); startService(music); } This is my Service class: class MusicService extends Service implements OnCompletionListener { MediaPlayer mediaPlayer; String musicFile; @Override public void onCreate() { mediaPlayer = new MediaPlayer(); mediaPlayer