android

Updated firebase dependency and got duplicated protobuf classes error

被刻印的时光 ゝ 提交于 2021-02-20 05:38:04
问题 I'm getting this error after updating one of my firebase SDKs FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:checkDebugDuplicateClasses'. > 1 exception was raised by workers: java.lang.RuntimeException: Duplicate class com.google.protobuf.AbstractMessageLite found in modules jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0) and jetified-protobuf-lite-3.0.1.jar (com.google.protobuf:protobuf-lite:3.0.1) Duplicate

Why I can't use runOnUiThread() to update an adapter?

独自空忆成欢 提交于 2021-02-20 05:12:59
问题 I have an adapter and a spinner view which is set to use the adapter for it's entries. I'm adding items to adapter from a list of all files in /assets/ folder, I found that this task takes very long time (even about 2 seconds for a list of 2 files on a 1.5Ghz phone!). Then I came up to use a worker thread to gather my list and not block UI thread. here is my code: @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.settings);

Why I can't use runOnUiThread() to update an adapter?

旧巷老猫 提交于 2021-02-20 05:12:46
问题 I have an adapter and a spinner view which is set to use the adapter for it's entries. I'm adding items to adapter from a list of all files in /assets/ folder, I found that this task takes very long time (even about 2 seconds for a list of 2 files on a 1.5Ghz phone!). Then I came up to use a worker thread to gather my list and not block UI thread. here is my code: @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.settings);

Why I can't use runOnUiThread() to update an adapter?

自闭症网瘾萝莉.ら 提交于 2021-02-20 05:08:37
问题 I have an adapter and a spinner view which is set to use the adapter for it's entries. I'm adding items to adapter from a list of all files in /assets/ folder, I found that this task takes very long time (even about 2 seconds for a list of 2 files on a 1.5Ghz phone!). Then I came up to use a worker thread to gather my list and not block UI thread. here is my code: @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.settings);

How do i download files to the local downloads folder?

江枫思渺然 提交于 2021-02-20 04:55:07
问题 I enabled the download settings for files with WebView. I'm saving files with DownloadManager. But the files do not appear in the local downloads directory. The files I've downloaded are save here. > file/storage/emulated/0/Android/data/com.myapp/files/x.mp3 I've tried a lot. But somehow it was not downloaded in the local downloads folder. What should I do? My Code String string = String.valueOf((URLUtil.guessFileName(url, contentDisposition, mimeType))); DownloadManager.Request request = new

Add multiple tags to marker

不羁岁月 提交于 2021-02-20 04:47:17
问题 Created i model like in answer. Also added tags in markers: MarkerTag tag = new MarkerTag(); Marker marker = map.addMarker(new MarkerOptions() .position(new LatLng(47.045029, 28.861427)) .title("Marker") .icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_AZURE)) .snippet("Population: 4,137,400")); tag.setEmail("first@gmail.com"); tag.setPhoneNumber("+37369490007"); marker.setTag(tag); Marker marker2 = map.addMarker(new MarkerOptions() .position(new LatLng(47.000327, 28

AndroidX migration - data binding error msg:Cannot find the setter for attribute 'android:visibility' with parameter type int

醉酒当歌 提交于 2021-02-20 04:42:45
问题 I'm migrating a project to AndroidX and have the following error : Caused by: java.lang.RuntimeException: android.databinding.tool.util.LoggedErrorException: Found data binding errors. ****/ data binding error ****msg:Cannot find the setter for attribute 'android:visibility' with parameter type int on androidx.constraintlayout.ConstraintLayout And the layout having the issue is : <androidx.constraintlayout.ConstraintLayout android:layout_width="match_parent" android:layout_height="wrap

Xamarin C# Android Call Logs

徘徊边缘 提交于 2021-02-20 04:34:42
问题 Im having trouble with this call logs of the device. The code is not returning the logs at all, It's giving false data. Code: public void ReadCalls() { try { Android.Content.Context myContext = Android.App.Application.Context; string myDateToCheck = myServiceRef.myTimeToCheck("CallLog"); if (myDateToCheck==null || myDateToCheck=="") {myDateToCheck = "0";} ICursor cursor = myContext.ContentResolver.Query( Android.Net.Uri.Parse ("content://call_log/calls"), null, "Date > ?", new string[]

Xamarin C# Android Call Logs

邮差的信 提交于 2021-02-20 04:34:13
问题 Im having trouble with this call logs of the device. The code is not returning the logs at all, It's giving false data. Code: public void ReadCalls() { try { Android.Content.Context myContext = Android.App.Application.Context; string myDateToCheck = myServiceRef.myTimeToCheck("CallLog"); if (myDateToCheck==null || myDateToCheck=="") {myDateToCheck = "0";} ICursor cursor = myContext.ContentResolver.Query( Android.Net.Uri.Parse ("content://call_log/calls"), null, "Date > ?", new string[]

Can't add the widget to the home screen - App isn't installed

眉间皱痕 提交于 2021-02-20 04:26:28
问题 I'm trying to create my first widget. I run the app through eclipse, and it launches fine. But when I try to add the widget from the widgets menu to the home screen I get a toast that says: App isn't installed When I look at the logcat I see this error: 05-15 18:35:10.533: E/Launcher(851): Error: appWidgetId (EXTRA_APPWIDGET_ID) was not returned from the \widget configuration activity. I don't have a configuration activity at all, and as far as I understood from the developer's site, it's not