Android X: tools:replace specified at line: for attribute, but no new value specified

I think you are migrating to AndroidX libs. Add below lines to gradle.properties file android.useAndroidX=true android.enableJetifier=true Remove tools:replace=”android:appComponentFactory” from manifest. Replace import from android.support.v7.app.AppCompatActivity to androidx.appcompat.app.AppCompatActivity in activities. Use replace in project to expedite the process of refactoring. Migrating to AndroidX

Android Studio two flavors with different manifest files

Tech background: on this link it explains the techniques and parameters that can be use for manifest merging: https://developer.android.com/studio/build/manage-manifests#merge_rule_markers One in specific is the tools:node that points out how certain XML nodes on the manifest should behave whilst merging. Solution: to achieve some permisions in one and different in other manifest, add ALL permissions you … Read more

AnalyticsService not registered in the app manifest – error

I am not sure if acting on this warning will solve the issue you’re having (i.e. not seeing any information in the Analytics admin site). Anyway, here is what you should add to AndroidManifest.xml inside the application tag if you want to get rid of this warning: <!– Optionally, register AnalyticsReceiver and AnalyticsService to support … Read more

How to show one layout on top of the other programmatically in my case?

Use a FrameLayout with two children. The two children will be overlapped. This is recommended in one of the tutorials from Android actually, it’s not a hack… Here is an example where a TextView is displayed on top of an ImageView: <FrameLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”fill_parent” android:layout_height=”fill_parent”> <ImageView android:layout_width=”fill_parent” android:layout_height=”fill_parent” android:scaleType=”center” android:src=”https://stackoverflow.com/questions/6690530/@drawable/golden_gate” /> <TextView android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:layout_marginBottom=”20dip” … Read more

How do you use Intent.FLAG_ACTIVITY_CLEAR_TOP to clear the Activity Stack?

I have started Activity A->B->C->D. When the back button is pressed on Activity D I want to go to Activity A. Since A is my starting point and therefore already on the stack all the activities in top of A is cleared and you can’t go back to any other Activity from A. This actually … Read more

List of Android permissions normal permissions and dangerous permissions in API 23? [duplicate]

As of API level 23, the following permissions are classified as PROTECTION_NORMAL: ACCESS_LOCATION_EXTRA_COMMANDS ACCESS_NETWORK_STATE ACCESS_NOTIFICATION_POLICY ACCESS_WIFI_STATE BLUETOOTH BLUETOOTH_ADMIN BROADCAST_STICKY CHANGE_NETWORK_STATE CHANGE_WIFI_MULTICAST_STATE CHANGE_WIFI_STATE DISABLE_KEYGUARD EXPAND_STATUS_BAR GET_PACKAGE_SIZE INSTALL_SHORTCUT INTERNET KILL_BACKGROUND_PROCESSES MODIFY_AUDIO_SETTINGS NFC READ_SYNC_SETTINGS READ_SYNC_STATS RECEIVE_BOOT_COMPLETED REORDER_TASKS REQUEST_IGNORE_BATTERY_OPTIMIZATIONS REQUEST_INSTALL_PACKAGES SET_ALARM SET_TIME_ZONE SET_WALLPAPER SET_WALLPAPER_HINTS TRANSMIT_IR UNINSTALL_SHORTCUT USE_FINGERPRINT VIBRATE WAKE_LOCK WRITE_SYNC_SETTINGS and Dangerous permissions : READ_CALENDAR WRITE_CALENDAR CAMERA READ_CONTACTS WRITE_CONTACTS … Read more

Android intent filter: associate app with file extension

You need multiple intent filters to address different situation you want to handle. Example 1, handle http requests without mimetypes: <intent-filter> <action android:name=”android.intent.action.VIEW” /> <category android:name=”android.intent.category.BROWSABLE” /> <category android:name=”android.intent.category.DEFAULT” /> <data android:scheme=”http” /> <data android:host=”*” /> <data android:pathPattern=”.*\\.pdf” /> </intent-filter> Handle with mimetypes, where the suffix is irrelevant: <intent-filter> <action android:name=”android.intent.action.VIEW” /> <category android:name=”android.intent.category.BROWSABLE” /> … Read more

What is use of android:supportsRtl=”true” in AndroidManifest xml file

Declares whether your application is willing to support right-to-left (RTL) layouts. If set to true and targetSdkVersion is set to 17 or higher, various RTL APIs will be activated and used by the system so your app can display RTL layouts. If set to false or if targetSdkVersion is set to 16 or lower, the … Read more

Android intent filter for a particular file extension?

Here is how I defined my activity in my AndroidManifest.xml to get this to work. <activity android:name=”com.keepassdroid.PasswordActivity”> <intent-filter> <action android:name=”android.intent.action.VIEW” /> <category android:name=”android.intent.category.DEFAULT” /> <category android:name=”android.intent.category.BROWSABLE” /> <data android:scheme=”file” /> <data android:mimeType=”*/*” /> <data android:pathPattern=”.*\\.kdb” /> <data android:host=”*” /> </intent-filter> </activity> The scheme of file indicates that this should happen when a local file is … Read more

intent.resolveActivity returns null in API 30

This appears to be due to the new restrictions on “package visibility” introduced in Android 11. Basically, starting with API level 30, if you’re targeting that version or higher, your app cannot see, or directly interact with, most external packages without explicitly requesting allowance, either through a blanket QUERY_ALL_PACKAGES permission, or by including an appropriate … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)