Android Question Error: android.content.res.Resources$NotFoundException: Resource ID #0x0

Discussion in 'Android Questions' started by JOTHA, Aug 14, 2018.

Tags:
  1. JOTHA

    JOTHA Well-Known Member Licensed User

    Hi experts,

    I have an app which worked fine, but since I've installed the upgrade B4A Version 8.30, there is an error-message when I click on an EditTextView (after that the app closes):

    On an Android Device with Android-Version 4.0.4 there are no error-messages, the app works well, but on another Device with Android-Version 7.1.1 the app doesn't work.

    Does someone know the reason why?
     
  2. DonManfred

    DonManfred Expert Licensed User

    Where is the project upload?
    Seems like you aare missing a Resource needed.Forgot to add #AdditionalRes line in your project?

    You need to provide more informations
     
    Peter Simpson likes this.
  3. Erel

    Erel Administrator Staff Member Licensed User

    I don't think that it is related to B4A version. Maybe you changed the theme or the targetSdkVersion.
     
  4. JOTHA

    JOTHA Well-Known Member Licensed User

    Yes, I think that I changed the minSDKVersion in the manifest, I deletet this entry in the manifest:
    Now I put it back, but the error-message is always here ...
     
  5. Erel

    Erel Administrator Staff Member Licensed User

    What is the targetSdkVersion set to?

    If there is no targetSdkVersion then your app is running with Android 2 theme. It is likely to cause problems on new devices.
     
  6. JOTHA

    JOTHA Well-Known Member Licensed User

    Yes Erel, I wanted to run the in this old style ...

    Now I have put this line to the manifest editor:
    The result is that the "android.content.res.Resources$NotFoundException: Resource ID #0x0"-problem is solved.

    But now I have a many other problems, for example:
    • How can I reduce the Activity.Title Text.size?
    • How can I change the Activity.Title Background Color?
    • How can I change the Activity.Title Height?
    • Before that I had EditText with white background, black Text and borders, now I have to change everything ...
    • Before that I had Buttons with Labels and ImageViews on top, now they are not visible ...
     
  7. Erel

    Erel Administrator Staff Member Licensed User

    You wrote:
    The error has nothing to do with B4A v8.30.


    You can use CSBuilder to change the text style.

    There is no simple way to change the Title height. You might be able to do it with AppCompat. However you should think about it and decide whether you want to use the standard theme like all other apps or you want to imitate the Android 2 theme and make your app look strange.

    That's true. I recommend you to set the text color to "default" (delete the color value in the designer).

    Buttons are elevated in the material theme. You can use Panels instead.
     
    Peter Simpson likes this.
  8. JOTHA

    JOTHA Well-Known Member Licensed User

    ... that means, Buttons are always in "BringToFront-Modus" and "ImageView1.BringToFront" doesn't work.
    I have to use Panels or Labels for that.
    ... or I underlay a Label in Colors.White.
    Is there another easy way to do that and use it together with android:targetSdkVersion="26"? o_O
     
  9. Erel

    Erel Administrator Staff Member Licensed User

    This means that you need to put the ImageView in a Panel and set the panel elevation. However this is not the best way to create a button with images. There are simpler ways.

    You can set the old theme with targetSdkVersion however your app will fail on some devices.
     
    JOTHA likes this.
  10. JOTHA

    JOTHA Well-Known Member Licensed User

    Hello Erel,
    thank you for the information.
    I put it on a Label ... and it works also. Is there any advantage caused by the elevation?
    ... so that will be a problem ...

    My decision is to use targetSdkVersion="26" in the future. ;)
     
  11. Erel

    Erel Administrator Staff Member Licensed User

    You must use it now if you want to upload your apps to Google Play.
     
    Peter Simpson and Johan Hormaza like this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice