android

set width of custom dialog to wrap content android

旧城冷巷雨未停 提交于 2021-02-18 21:11:08
问题 I want to set the width of custom dialog to wrap content but always it fill all the width of the screen I have tested this android.view.WindowManager.LayoutParams params = mydialog.getWindow().getAttributes(); params.width = android.view.WindowManager.LayoutParams.WRAP_CONTENT; mydialog.getWindow().setAttributes((android.view.WindowManager.LayoutParams) params); and that mydialog.getWindow().setLayout(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); 回答1: I also having a hard time in

Android 9 WebView (also admob ads) not loading after Chrome update

人走茶凉 提交于 2021-02-18 21:10:03
问题 We have an application that depends heavily on web views we noticed after last week that if an android 9 user spent some time loading webviews about 10 to 30 after that webviews just show blank page and loading progress gets stock at 10% Also admobe native ads stop showing the only thing changed was chrome update to 77.0.3865.73 we tested on android 9 that has not updated to that version everything works perfectly ( chrome 74.0.3729.136) when debugging the only message I get is : E/chromium:

How to rename a file in Android knowing only its media content Uri

孤人 提交于 2021-02-18 21:00:43
问题 In Android Q the MediaStore.Files.FileColumns.DATA field has been deprecated, and may be null or apps may not have the rights to read it, therefore is there a way to rename the filename section (not the path) of a file using only its media content Uri? Until now the DATA field could be used to find the real path of a file from a known Uri, but since it has been deprecated then the idea is not to even try to find or resolve the real file path, and use only its content Uri. Consider that the

OkHttp enable/disable gzip compression on requests

懵懂的女人 提交于 2021-02-18 20:59:42
问题 I'm using Retrofit to manage my requests and want to make some tests to check de request size using or not using gzip. By default does OkHttp performs gzip compression to requests or it must be implemented with an interceptor? I've added @Headers({ "Accept-Encoding: gzip, deflate", "Content-Encoding: gzip" }) or: @Headers({ "Content-Type: application/json;charset=utf-8", "Accept: application/json" }) to my requests and did not see any change on the request length. 回答1: OkHttp will do

“cannot find symbol method metafactory” using Lambda

喜夏-厌秋 提交于 2021-02-18 20:44:39
问题 I'm using java 8 and lambda expressions. When I use lambda expressions with OnClickListeners everything is fine, but when I use that in this animate method: public void configureFragmentToolbar(String title, boolean displayHomeAsUpEnabled) { //.. this.toolbar.animate().translationY(-50).setDuration(300).withEndAction(() -> { //ERROR toolbar.animate().translationY(0).setDuration(300); }); } I´m getting this error: "error: cannot find symbol method metafactory(Lookup,String,MethodType

Android Studios doesn't understand Log function

我们两清 提交于 2021-02-18 20:43:53
问题 I'm fairly new to android programming in general, and I'm having problems with printing to my log. I'm using Log.v() to do it, but I get an error: "cannot resolve symbol v" This is the code: import android.util.Log; public class DressDatabase { Dress[] dresses; private static final String TAG = "Testing: "; public DressDatabase(){ dresses = new Dress[15]; } Log.v(TAG, "String"); } 回答1: Try this: import android.util.Log; public class DressDatabase { Dress[] dresses; private static final String

Android Studios doesn't understand Log function

旧街凉风 提交于 2021-02-18 20:42:58
问题 I'm fairly new to android programming in general, and I'm having problems with printing to my log. I'm using Log.v() to do it, but I get an error: "cannot resolve symbol v" This is the code: import android.util.Log; public class DressDatabase { Dress[] dresses; private static final String TAG = "Testing: "; public DressDatabase(){ dresses = new Dress[15]; } Log.v(TAG, "String"); } 回答1: Try this: import android.util.Log; public class DressDatabase { Dress[] dresses; private static final String

Adding icon to left of DropDownButton (expanded) in flutter

吃可爱长大的小学妹 提交于 2021-02-18 20:41:05
问题 I want to add icon to left of DropDownButton but can't find a way to do so. What I want to achieve is like this: I have tried following code but it places icon to right where I don't want it and it also overrides arrow icon: `@override Widget build(BuildContext context) { return Scaffold( body: Container( margin: EdgeInsets.only(top: 64.0, left: 16.0, right: 16.0), color: Colors.white, child: DropdownButton( icon: Icon( Icons.person, color: Colors.redAccent, size: 20.09, ), isExpanded: true,

Can an android.hardware.camera2.CaptureRequest be used with OpenCV?

那年仲夏 提交于 2021-02-18 20:26:55
问题 I've worked on this for days now. I have an OpenCV/JavaCameraView-based project I am trying to integrate with an Android android.hardware.camera2.CaptureRequest object I use to control the camera's sensitivity to light. The CameraBridgeViewBase.CvCameraViewListener2/JavaCameraView project works (I can see an image on the screen), and the CaptureRequest project works (see this, too), but combining the two technologies in a single project has proved a big problem. Has anyone gotten these two

Can an android.hardware.camera2.CaptureRequest be used with OpenCV?

。_饼干妹妹 提交于 2021-02-18 20:26:05
问题 I've worked on this for days now. I have an OpenCV/JavaCameraView-based project I am trying to integrate with an Android android.hardware.camera2.CaptureRequest object I use to control the camera's sensitivity to light. The CameraBridgeViewBase.CvCameraViewListener2/JavaCameraView project works (I can see an image on the screen), and the CaptureRequest project works (see this, too), but combining the two technologies in a single project has proved a big problem. Has anyone gotten these two