Page 117

Android Programming Cookbook

109 / 143

Figure 6.4: Add an activity to Mobile. Choose: Add no activity. Now press finish, and our project has just been created.


Create the layout of the project

Add a new xml file inside /res/layout folder, with name main_activity.xml. We should have the res/layout/ main_activity.xml file and paste the code below. main_activity.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#ffffff" android:orientation="vertical"> < android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="58dp" android:background="?attr/colorPrimary" android:minHeight="?attr/actionBarSize" android:title="@string/app_name"></> <com.javacodegeeks.androidmultitouchexample.TouchableFrameLayout android:id="@+id/touchable_frame"


This is Yahya Christian School Magazine

Read more
Read more
Similar to
Popular now
Just for you