Hello World blank screen on startup
Hello World blank screen on startup
I started working with android studio and was following a book making a hello world app. As soon as I finish first declaring the project and running gradle it's supposed to have a header with hello world at the top like this
But instead I get
this
I haven't touched any of the code. But here's the activity_quiz.xml
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".QuizActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
Any help?
So I'm retarded, used the avd and it works, but is there any way I can instantly see changes I make to the design without running the app everytime?
– gunnersFc
Jun 30 at 7:46
So I guess a better question would be is, why is the preview always blank??
– gunnersFc
Jun 30 at 7:53
I'd hazard a guess that it's your constraints on the textview. Avoid using "left" and "right", instead use "start" and "end". Using left and right is not recommend. ConstraintLayout can be a bit of a learning curve, but once you master it, it's much better for design than anything else.
– Timothy Winters
Jun 30 at 8:15
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
it would help if you show the onCreate method in it's entirety.
– Timothy Winters
Jun 30 at 7:44