Earl Whitney
Lurker
Novice needs help getting started. I am working through the book “Android Programming in Kotlin: Starting with an App.” This is my first program, and I just started Android Studio.
When I start an app in Android Studio 3.1.3 and select “Basic activity,” as instructed in the book, the Android Preview screen shows “android…CoordinatorLayout” instead of the Hello World! text that should be on the screen.
When I Run the App, it works in an emulator, showing the Hello World! text, but I cannot see the text on the xml file Design screen because it is grayed out and has the “android…CoordinatorLayout” text on it.
I read a forum entry somewhere that said I should use an “AppCompat” theme to fix this. I did that and the resulting screen is blank - I cannot see the Hello World! text in the xml file Design preview. “android…CoordinatorLayout” is gone, but there is no text in its place.
Here is the activity_main.xml file code, all of which was generated by Android Studio:
Any help would be greatly appreciated. Thank you.
When I start an app in Android Studio 3.1.3 and select “Basic activity,” as instructed in the book, the Android Preview screen shows “android…CoordinatorLayout” instead of the Hello World! text that should be on the screen.
When I Run the App, it works in an emulator, showing the Hello World! text, but I cannot see the text on the xml file Design screen because it is grayed out and has the “android…CoordinatorLayout” text on it.
I read a forum entry somewhere that said I should use an “AppCompat” theme to fix this. I did that and the resulting screen is blank - I cannot see the Hello World! text in the xml file Design preview. “android…CoordinatorLayout” is gone, but there is no text in its place.
Here is the activity_main.xml file code, all of which was generated by Android Studio:
Code:
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout 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=".MainActivity">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="[USER=19691]@Style[/USER]/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?android:attr/actionBarSize"
android:background="?android:attr/colorPrimary"
app:popupTheme="[USER=19691]@Style[/USER]/AppTheme.PopupOverlay" />
</android.support.design.widget.AppBarLayout>
<include layout="@layout/content_main" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
app:srcCompat="@android:drawable/ic_dialog_email" />
</android.support.design.widget.CoordinatorLayout>
Any help would be greatly appreciated. Thank you.
Last edited: