Category : android

So my understanding is that View has different lifecycle then Fragment, I have noticed that by adding confingChanges to MainActivity android:name=".MainActivity" android:configChanges="orientation|screenSize|keyboardHidden", my WebView (or maybe the whole Fragment) is not being destroyed on rotation (or at least it seems like it is not being destroyed) i.e the Website is not being reloaded, so how ..

Read more

I’m trying to get the path from this uri: content://com.android.providers.downloads.documents/document/29 But I’m always getting a return null in the method below. Some help will be apprecite! This is my method: private fun getDataColumn( context: Context, uri: Uri?, selection: String?, selectionArgs: Array<String>? ): String? { val column = "_data" val projection = arrayOf( column ) uri?.let ..

Read more

I am facing a problem related to Android Intent-Filters esp. in data-element with a path pattern Reference: https://developer.android.com/guide/topics/manifest/data-element I need to match a regex for valid URLs like anything-to-anything-trains fromString-to-toString-trains Below mentioned (regex) is working almost perfectly <data android:pathPattern=".*to.*trains" /> <data android:pathPattern=".*to.*trains/" /> However, this regex is failing when from or to contain keyword ‘t’ ..

Read more

I’m creating an audiobook player, and I’m using MediaSessionCompat related classes to handle notifications. My code is heavily inspired by the android-MediaBrowserService samples ( https://github.com/googlearchive/android-MediaBrowserService ), and i’m not quite understanding it all for the moment ( the createContentIntent espicially ) Here is my simple class in charge of building notifications from a bookPlayer providing ..

Read more