android-manifest

Is PackageManager.getComponentEnabledSettings() persistent between cold starts?

末鹿安然 提交于 2020-01-01 03:35:27
问题 If I use the code below to disable a static BroadcastReceiver defined in AndroidManifest.xml, will it be re-enabled after a reboot? It doesn't appear to be but the docs don't say whether it should. final ComponentName compName = new ComponentName(context, MyBroadcastReceiver.class); context.getPackageManager().setComponentEnabledSetting( compName, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP); Thanks in advance... 回答1: Is PackageManager

Build failed after updating tools for Android L

▼魔方 西西 提交于 2020-01-01 01:38:30
问题 I cannot build my project after updating the tools. I get this error in Android Studio. /build/exploded-aar/com.android.support/support-v4/21.0.0-rc1/AndroidManifest.xml:3] Failed to parse : must be an integer number or codename. Any ideas? This manifest is from the support library I think. I also have another for my project which is min=14 target=19 <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2014 The Android Open Source Project Licensed under the Apache License, Version 2.0

Extended Application class - Force Close on Restart Android

泪湿孤枕 提交于 2019-12-31 07:16:44
问题 I have my AppMain class [My class Name] that extended the Application class in my app. That have some Globals. I have mentioned inside the manifest. and my app running normal. I have exit button in my app to quit it using System.exit(0); . After that when I start my app using Recent Apps option, it just crashed. ( FYI. Hold down the Home key and the recent apps will appear) Starting the app from Apps List it is fine. How can I fix this? Here part of my manifest: <application android:name="

How can I ask for external file access permission in Android Q?

这一生的挚爱 提交于 2019-12-31 05:42:38
问题 Heard Android Q introduced a new security feature called “Scoped Storage” which restricts access files in external storage. My problem is I have to save a text document to a user specified location from the App. Is this requires any kind of permission rather than READ_EXTERNAL_STORAGE and WRITE_EXTERNAL_STORAGE in Q devices? 回答1: My problem is I have to save a text document to a user specified location from the App Use ACTION_CREATE_DOCUMENT to allow the user to specify the location. You can

Android App is not showing for tablet users of Google play store

时光总嘲笑我的痴心妄想 提交于 2019-12-31 04:37:10
问题 My android app is not found through tablets in google play store. the App manifest is as : <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:smallScreens="true" android:xlargeScreens="true" /> <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="18" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission

“Error Parsing XML: XML declaration not well-formed” [android]

半城伤御伤魂 提交于 2019-12-31 03:58:09
问题 I'm getting the titled error in my AndroidManifest.xml file. The error is on the line below the < / manifest>. <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.contactpicker" <uses-permission android:name="android.permission.READ_CONTACTS"/> <application android:icon="@drawable/ic_launcher"> <activity android:name=".ContactPicker" android:label="@string/app_name"> <intent-filter> <action android:name="android

Android activity restarted at orientation change even with configChanges set

廉价感情. 提交于 2019-12-31 03:37:10
问题 I have an Android library project and the main application that uses this library project. The manifest file of the main application looks as follows: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.test.myapp" android:installLocation="preferExternal" android:versionCode="3" android:versionName="1.1" > <uses-sdk android:minSdkVersion="8" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission

Disabling an app or activity zoom if Setting -> Display -> Display size changed to Large or small

假装没事ソ 提交于 2019-12-30 11:20:08
问题 In my app, I don't want to allow it to resize as its creating design issues. I have tried with android:resizeableActivity="false" in the application tag and the launcher activity tag but it didn't help. 回答1: I have found a solution for it. If system text size changed or Display size set to Large (Above Android Oreo), Your app will behave as normal (No big text and and zoomed views) with below code: Configuration configuration = getResources().getConfiguration(); configuration.fontScale =

Is there a way to check for manifest permission from code?

試著忘記壹切 提交于 2019-12-30 00:57:09
问题 How do I check for a specific permission in the manifest.xml from code? I want to throw some exception if some permissions that are necessay for my application are missing. For example , FINE_LOCATION and COARSE_LOCATION I know that android will also throw an exception on the launch of the specific activiy that is using GPS, but I need to check the manifest and throw an exception at the launch of the application itself. This holds not only for location access, but also for other permissions.

The audio volume is zero?

允我心安 提交于 2019-12-29 09:37:09
问题 I have an application with a mute button. I have been stuck on this for 4 and a half hours now, so I am plain desperate. I am trying to have the volume mute when user clicks mute and unmute when user clicks it again. This works fine, except the audio isn't playing. For some reason, Stream_Music is 0? public void mute(View view) { mutebutton = (ImageButton) findViewById(R.id.mutebutton); if ((variableForMute.x % 2) != 0) { //If it's odd UNMUTE Log.v(TAG, "Use this volume to unmute "