android-resources

android system-app update needs rebooting device

偶尔善良 提交于 2019-12-02 17:02:18
问题 I have to update app which is present under /system/priv-app/ using adb install -r "APK path " .After installation version name is changing to latest in setting app.but once i open app first time it crashes and then runs with old code.I added only one line log in new version, result was same app crashed with ResourceNotFound Exception. After long struggle i tried rebooting phone then it is working fine.One more thing I would like to add is previous app was built on Eclipse and update is built

How to load icon from icon pack

喜欢而已 提交于 2019-12-02 12:54:46
问题 I want to use an icon from an icon pack. I know how to find installed icon packs. But I can't find out how to load an icon from an icon pack. Find icon packs - WORKS That's how I find icon packs: private static ArrayList<String> getInstalledIconPacks(String filter) { ArrayList<String> packs = new ArrayList<>(); List<ResolveInfo> infos = MainApp.get().getPackageManager().queryIntentActivities(new Intent(filter), PackageManager.GET_META_DATA); if (infos != null) { for (int i = 0; i < infos.size

Audio not playing in android. android.content.res.Resources$NotFoundException: Resource ID #0x0

对着背影说爱祢 提交于 2019-12-02 09:45:34
I am trying to play an audio file in Android but it seems to crash and give a the ResourcesNotFoundException . The audio file is saved in the raw folder inside res. The name of the audio file is determined by a randomly generated number which is then concatenated to "audio". int res = getResources().getIdentifier ( "audio"+arrayIndex, "raw","com.din.askak" ); MediaPlayer mPlayer = MediaPlayer.create ( MainActivity.this, res ); In the logcat it seems to throw the exception on the line creating the mediaPlayer. I don't know what I seem to be doing wrong??? Mohamed Fadl Allah Use of getIdentifier

java.lang.NullPointerException while referencing string variable in code

橙三吉。 提交于 2019-12-02 08:28:02
问题 This question was migrated from Android Enthusiasts Stack Exchange because it can be answered on Stack Overflow. Migrated 4 years ago . I'm trying to reference a few strings that I've stored in an xml. I'm getting this error: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resourcesandroid.content.Context.getResources()' on a null object reference at android.content.ContextWrapper.getResources(ContextWrapper.java:86) on the line where I'm using

android system-app update needs rebooting device

不羁的心 提交于 2019-12-02 08:19:52
I have to update app which is present under /system/priv-app/ using adb install -r "APK path " .After installation version name is changing to latest in setting app.but once i open app first time it crashes and then runs with old code.I added only one line log in new version, result was same app crashed with ResourceNotFound Exception. After long struggle i tried rebooting phone then it is working fine.One more thing I would like to add is previous app was built on Eclipse and update is built on Android studio . Attached logs- FATAL EXCEPTION: main E/AndroidRuntime(21895): Process: com.app,

Migrate resource files to Androidx

别来无恙 提交于 2019-12-02 03:19:22
问题 I am doing refactoring --> migrate to Androidx in an Android Studio project. I am noticing that only java files are been migrated, but not the xml resources. It exists one method to automatically migrate them too? 回答1: No, but one can right-click res directory, then "search" -> "replace in path" in order to replace all the open/close tags, according to the migration guide. 来源: https://stackoverflow.com/questions/58066250/migrate-resource-files-to-androidx

Migrate resource files to Androidx

萝らか妹 提交于 2019-12-02 01:53:57
I am doing refactoring --> migrate to Androidx in an Android Studio project. I am noticing that only java files are been migrated, but not the xml resources. It exists one method to automatically migrate them too? No, but one can right-click res directory, then "search" -> "replace in path" in order to replace all the open/close tags, according to the migration guide. 来源: https://stackoverflow.com/questions/58066250/migrate-resource-files-to-androidx

How to open a PDF file from res/raw Folder?

本秂侑毒 提交于 2019-12-02 01:07:35
I am writing an application that opens a pdf file when you click a button. Below is my code: File pdfFile = new File( "android.resource://com.dave.pdfviewer/" + R.raw.userguide); Uri path = Uri.fromFile(pdfFile); Intent intent = new Intent(Intent.ACTION_VIEW); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); intent.setDataAndType(path, "application/pdf"); startActivity(intent); However when I run it and press the button it says "The document cannot be opened because its is not a valid PDF document". This is driving me mad. Am I accessing the file correctly? Any ideas? Thanks You have to copy

Xamarin.Droid: Resource.Designer.cs broken after update

≡放荡痞女 提交于 2019-12-01 22:31:11
问题 I'm using Xamarin for Android and I'm using the support libraries. The project work fine, but after updating the support repositories from 23.1.1.1 to 23.3.0 , the Resource.Designer.cs is broken. Note: I did delete the file, I did a complete rebuild with manually deleting the obj and bin folders and I made shure all of my Android packages are up to date (Android SDK Manager). The errors are all part of the public static void UpdateIdValues() function all basically all look like this:

Xamarin.Droid: Resource.Designer.cs broken after update

ⅰ亾dé卋堺 提交于 2019-12-01 18:40:23
I'm using Xamarin for Android and I'm using the support libraries. The project work fine, but after updating the support repositories from 23.1.1.1 to 23.3.0 , the Resource.Designer.cs is broken. Note: I did delete the file, I did a complete rebuild with manually deleting the obj and bin folders and I made shure all of my Android packages are up to date (Android SDK Manager). The errors are all part of the public static void UpdateIdValues() function all basically all look like this: 'Resource.Color' does not contain a definition for 'design_textinput_error_color' With the code: global::Acr