Time for action - integration with the layout example

The integration of the RelativeLayout example is almost identical to the integration of the custom CircleLayout example that you wrote earlier. Integration will require a new Activity implementation, and then we need to register it with Android and the LayoutSelectorActivity.

  1. Create a new Java source file in the root package of the "layouts" example project, named RelativeLayoutActivity.java. Open this in your editor or IDE.
  2. The new RelativeLayoutActivity needs to extend the Activity class:
    public class RelativeLayoutActivity extends Activity {
    
  3. Override the onCreate method:
    protected void onCreate(Bundle savedInstanceState) {
    
  4. Invoke the super class to set up its state:
    super.onCreate(savedInstanceState); ...

Get Android User Interface Development now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.