android-developer-api

Android MediaPlayer is paused, volume buttons do not control multimedia

一笑奈何 提交于 2021-02-19 03:35:12
问题 I played a sample music (.mp3) using a sample code I found on the Internet. The code is something like MediaPlayer mp = new ... mp.setDataSource(... mp.setAudioStreamType(... mp.prepare(); mp.start(); The problem is that when the music is paused, the volume buttons do not control multimedia volume but notification volume. mp.pause(); This behaviour is different from other music players I have tested. Samsung's built-in Music, VLC, and other programs still showed multimedia volume when the

Android Q ConnectivityManager.requestNetwork with timeout shows error Dialog that stops any subsequent requests

可紊 提交于 2021-02-11 14:19:27
问题 I'm using Android's ConnectivityManager.networkRequest(..) with a timeout to get a hold of a specific network after a queue from user input. Everything works fine most of the time, but if I let the request timeout, I notice I get another Dialog saying Something came up. The application has cancelled the request to choose a device." which requires the user to manually dismiss it before we can do any other network requests. My questions is: How can I dismiss this dialog programmatically? I do

Why can't I upload a picture from gallery in my android app, if the picture was taken with the camera app from android?

浪尽此生 提交于 2021-02-11 12:22:27
问题 I want to upload an image from gallery and show it on my Android app. This works fine if I select an image from the screenshot folder for example. But when I select an image from the folder where the pics, taken with the phone camera, are stored, it does not work. public void UploadPicture(View v) { Intent pickPhoto = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI); startActivityForResult(pickPhoto , 1); protected void onActivityResult(int

Why can't I upload a picture from gallery in my android app, if the picture was taken with the camera app from android?

前提是你 提交于 2021-02-11 12:21:14
问题 I want to upload an image from gallery and show it on my Android app. This works fine if I select an image from the screenshot folder for example. But when I select an image from the folder where the pics, taken with the phone camera, are stored, it does not work. public void UploadPicture(View v) { Intent pickPhoto = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI); startActivityForResult(pickPhoto , 1); protected void onActivityResult(int

Code for sending ArrayAdapter to another activity?

混江龙づ霸主 提交于 2021-02-02 09:56:58
问题 As we can send String type to another activity like this public static final String EXTRA_MESSAGE = "com.example.android.twoactivities.extra.MESSAGE"; what should be the code for this private static final ArrayAdapter LIST_OF_CUSTOMERS = P.S.- I am writing this code in MainActivity and want to send Database in the form of ListView to another activity named saveScreen 回答1: My first suggestion would be why cant the second activity simply query the database itself? Other then that if you must I

Code for sending ArrayAdapter to another activity?

北城余情 提交于 2021-02-02 09:52:32
问题 As we can send String type to another activity like this public static final String EXTRA_MESSAGE = "com.example.android.twoactivities.extra.MESSAGE"; what should be the code for this private static final ArrayAdapter LIST_OF_CUSTOMERS = P.S.- I am writing this code in MainActivity and want to send Database in the form of ListView to another activity named saveScreen 回答1: My first suggestion would be why cant the second activity simply query the database itself? Other then that if you must I

How to auto-resize imageview for different screen sizes android studio?

落爺英雄遲暮 提交于 2020-12-30 03:14:17
问题 I am starting to develop apps for android devices using Android Studio. While I was testing my app for screen size compatibilty I noticed that the imageviews do not auto-resize. The imageview placement looks completely different in different screen sizes. If the screen is small enough, the imageview will sometimes be placed outside of the viewscope. I have looked all over the internet but I am a little confused on how to make the app compatible with most screen sizes (not including tablets).

How to auto-resize imageview for different screen sizes android studio?

半腔热情 提交于 2020-12-30 03:12:49
问题 I am starting to develop apps for android devices using Android Studio. While I was testing my app for screen size compatibilty I noticed that the imageviews do not auto-resize. The imageview placement looks completely different in different screen sizes. If the screen is small enough, the imageview will sometimes be placed outside of the viewscope. I have looked all over the internet but I am a little confused on how to make the app compatible with most screen sizes (not including tablets).

How to auto-resize imageview for different screen sizes android studio?

為{幸葍}努か 提交于 2020-12-30 03:03:52
问题 I am starting to develop apps for android devices using Android Studio. While I was testing my app for screen size compatibilty I noticed that the imageviews do not auto-resize. The imageview placement looks completely different in different screen sizes. If the screen is small enough, the imageview will sometimes be placed outside of the viewscope. I have looked all over the internet but I am a little confused on how to make the app compatible with most screen sizes (not including tablets).

Android API to Connect to Wifi Network

戏子无情 提交于 2020-12-15 05:49:47
问题 I'm totaly lost in the versions of WiFi APIs. I want to connect to a configured WiFi Network programmaticaly. As decribed in this question: Connect to wifi network Android programmatically I develop on Android 10 and want to write a code that is also compatible with older Android Versions. On my android 10 the code described does not work. What code do I need to implement the functionality on Android 10? What do I do to write an application that also runs on my other Android 9 phone? Regards