Snippet Untitled
8 months ago
            public interface LayoutLoaderInterface {
    void loadLayout(Bundle bundle);
}

public abstract class MyBaseActivity extends Activity implements LayoutLoaderInterface {
     abstract public void loadLayout(Bundle bundle);

     public void onCreate(Bundle bundle) {
        super(bundle);
        loadLayout(bundle);
     }
}

public class MyFirstActivity extends MyBaseActivity {
     public void loadLayout(Bundle bundle) {
        //TODO: load layout 1
     }
}

public class MySecondActivity extends MyBaseActivity {
     public void loadLayout(Bundle bundle) {
        //TODO: load layout 2
     }
}
        
add