I bought book Bill Phillips & Brian Hardy "Android programming the big nerd ranch guide". And in the first chapter, I created Gradle solution using idea instead eclipse. This project generated by idea doesn't compile.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_quiz);
if (savedInstanceState == null) {
getSupportFragmentManager().beginTransaction()
.add(R.id.container, new DummyFragment())
.commit();
}
}
xml:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".QuizActivity$DummyFragment">
<TextView
android:text="@string/hello_world"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
error: cannot find symbol variable container
I have not changed anything, but project doesn't compile
Please help me.
container
id in yourxml
file and inactivity_quiz
layout?android:id = "@+id/container"
to your layout