1

I'm using Android studio and I've setted a background image in this way :

android:background="@drawable/logo"

Error state that remove @ sign before "@drawable/logo

And the preview screen it's just white, on the phone app I can see the image perfectly.

While there is no problems with color and it also show in background in phone app.

I don't get it. What am I doing wrong? Also I've tried pressing 'R' on the preview view, but when the spinner finished, nothing happened.

Thank you.

4
  • Can you post your xml file here? Commented Jul 24, 2018 at 16:28
  • Please post your xml here Commented Jul 24, 2018 at 18:24
  • Image is : <ImageButton android:id="@+id/image_login" android:layout_width="wrap_content" android:layout_height="wrap_content" app:layout_constraintBottom_toTopOf="parent" app:layout_constraintEnd_toStartOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" app:srcCompat="@drawable/login" /> Commented Jul 25, 2018 at 17:45
  • No, it gives massage that'The resource name must login with a character less... validates with references inside Android XML Files. Commented Jul 25, 2018 at 17:51

2 Answers 2

2

Your problem is on the line:

android:background="@drawable/logo" 

This should be:

android:background="@android:drawable/logo" 

you are missing the "android:" part before the drawable so it is incorrect format.

Sign up to request clarification or add additional context in comments.

2 Comments

Nope. That means it's a system resource. That is, android.R.drawable.logo. There is no such drawable in the SDK, and I would imagine the OP is wanting to use their own image anyway.
No, it gives massage that'The resource name must login with a character less... validates with references inside Android XML File
0
  1. Check your Android Studio and Gradle version and if older one, upgrade to new version.
  2. Clean your project and close the project.
  3. Reopen the project.

It will be working well. Good luck.

1 Comment

It's android studio 3.1.1, No, it gives massage that'The resource name must login with a character less... validates with references inside Android XML File

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.