Jan Lund
10/01/2020, 5:20 PMChristopher Elías
10/02/2020, 1:42 PMzsperske
10/02/2020, 5:22 PMonStart
is always called (even when you've backgrounded the app and returned) what is its purpose? How do you do something only once after a fragment's view is created?Kavita
10/02/2020, 5:26 PMMockWebSerever
& Awaitility
to handle API mocking & async operation.
The .gradle
file also has Android Orchestrator & clearPackageData declared. All the tests are independent.
Still, the issue persists.
Can someone help me to fix this issue?
Please let me know if you need more details about tests & Android version.Antoine Gagnon
10/02/2020, 6:24 PMNikola Milovic
10/03/2020, 6:59 AM/storage/1018-2710/Pictures/Sarx7IIJi-o.jpg
, but when I try to share the image I get an error saying Failed to find configured root that contains /storage/1018-2710/Pictures/Sarx7IIJi-o.jpg
. I have configured everything from the docs , but I cannot figure out which combination I need for my file-paths.xml file. I am currently using this
<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="<http://schemas.android.com/apk/res/android>">
<external-path name="external_files" path="/" />
</paths>
But this is the wrong location for the files I need.
Basically, I am asking which one of these do I need to be able to access files from the MediaStore.Images ie /Pictures directory.
Thank you! I tried googling and reading the docs but that got me to this point.fummicc1
10/03/2020, 9:00 AMA failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution
when using Room framework(may be library?).
I make an application to practice Room
, referring to this official course.
I create Entity
, DAO
, Database
, Repository
, ViewModel
and Converter
to persist Date
in SQLite. almost all things are done.
but when I try to debug my application from Android Studio, I got this error A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution
(please look at the attached image).
If anyone else can help me, this repository on GitHub can reproduce this issue so please check it.
Please tell me how to solve this problem.
P.S
this is more detail error description.
* What went wrong:
Execution failed for task ':app:kaptDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution
> java.lang.reflect.InvocationTargetException (no error message)
Daniel
10/03/2020, 2:13 PM// Annotates class to be a Room Database with a table (entity) of the Word class
@Database(entities = arrayOf(Word::class), version = 1, exportSchema = false)
public abstract class WordRoomDatabase : RoomDatabase() {
abstract fun wordDao(): WordDao
companion object {
// Singleton prevents multiple instances of database opening at the
// same time.
@Volatile
private var INSTANCE: WordRoomDatabase? = null
fun getDatabase(context: Context): WordRoomDatabase {
val tempInstance = INSTANCE
if (tempInstance != null) {
return tempInstance
}
synchronized(this) {
val instance = Room.databaseBuilder(
context.applicationContext,
WordRoomDatabase::class.java,
"word_database"
).build()
INSTANCE = instance
return instance
}
}
}
}
The code contains a number of things I don't understand (@Volatile
, synchronized
), and Android Studio warns that synchronized
is a Kotlin internal with no stability guarantees.
Copying in something I don't understand which uses internal APIs I don't understand doesn't feel like a great idea. Is there an alternative?Ayden
10/03/2020, 2:34 PMobserve()
to observe the ViewModel?
I bit confuse.Yamila Gammeri
10/05/2020, 12:02 AMTim Malseed
10/05/2020, 12:51 AMimplementation(project(":ktaglib:lib", { "release" }))
But this doesn’t seem to resolve the problemRajsingh Techm18
10/05/2020, 7:17 AMArchie
10/05/2020, 2:01 PMACCESS_FINE_LOCATION
and ACCESS_COARSE_LOCATION
count as accessing BACKGROUND_LOCATION
? I have an app which request both of those permissions for Google Maps
and I am receiving warnings about BACKGROUND_LOCATION
after uploading the apk in playstore. I don't used FusedLocationService
in the app as well just the google maps itself so I'm really confused about the warning presented ng Google Play
. Can anyone shed a light on this? Is there something I should be doing?tseisel
10/05/2020, 4:14 PMandroidExtensions
block ?brandonmcansh
10/06/2020, 12:52 AMCorey Lanier
10/06/2020, 3:20 AMChris Fillmore
10/07/2020, 2:10 AMclass MyViewModel : ViewModel() {
private val users: MutableLiveData<List<User>> by lazy {
MutableLiveData().also {
loadUsers()
}
}
fun getUsers(): LiveData<List<User>> {
return users
}
private fun loadUsers() {
// Do an asynchronous operation to fetch users.
}
}
It is not clear how loadUsers()
could be implemented, as MyViewModel
accepts no dependencies. In particular, if I want to instantiate MyViewModel like so:
val model: MyViewModel by viewModels { SavedStateViewModelFactory(this.application, this) }
it’s not clear to me how I could pass dependencies (like “MySomethingRepository”) to the view modelChris Fillmore
10/07/2020, 2:11 AMandroidx.activity
function viewModels()
and pass dependencies to e.g. MyViewModel
?coroutinedispatcher
10/07/2020, 6:12 AMDmitry Khasanov
10/07/2020, 8:24 AM1.4.x
in some of dependencies (latest okhttp library for example) and 1.3.72
in the project and in some other dependencies too?hisham bin awiad
10/07/2020, 9:24 AMGeert
10/07/2020, 12:55 PMval intent = Intent(Settings.ACTION_MANAGE_DEFAULT_APPS_SETTINGS)
startActivity(intent)
but the user still needs to click a few times and they probably don’t kno where. I want them to set it to always when they launch the app the first timePau
10/07/2020, 1:23 PMRobert Menke
10/07/2020, 2:39 PMMediaMuxer
in memory before writing to disk. The general approach is:
• Create a MemoryFile
• Create a CipherInputStream
from the `MemoryFile`’s InputStream
• Give the `MemoryFile`’s FileDescriptor
to the MediaMuxer
constructor
• Create a FileOutputStream
from the CipherInputStream
Right now I’m having to use reflection to get the file descriptor from MemoryFile
and I’m curious why the getter is unsupported for app usage https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/os/MemoryFile.java#230.Slackbot
10/07/2020, 3:22 PMJuan Rodríguez
10/07/2020, 3:28 PMstopListening()
method as well as the cancel()
method, but they are both ignored and nothing happens.
I don't know if anyone has done this before, but I appreciate any helpSlackbot
10/07/2020, 8:24 PMed_mayen
10/08/2020, 7:21 PMghosalmartin
10/09/2020, 7:09 AMAyden
10/09/2020, 10:14 AMViewHolder
class which in charges of populating the data to the quote_list.xml
.
I create a setOnClickListener
on the ViewHolder which would call a QuoteFragment
that populated the relevant data into it.
May I know how to populate the data from the ViewHolder
to the QuoteFragment
?
inner class QuoteViewHolder(private val bindingQuoteListBinding: QuoteListBinding) :
RecyclerView.ViewHolder(bindingQuoteListBinding.root) {
fun bind(quote: Quote) {
// Assign data to the textview
bindingQuoteListBinding.tvQuote.text = quote.quote
bindingQuoteListBinding.tvAuthor.text = quote.author ?: "None"
bindingQuoteListBinding.cardQuote.setOnClickListener {
val activity = it.context as AppCompatActivity
val fragment = QuoteFragment()
fragment.show(activity.supportFragmentManager, "TAG")
}
}
}