Q:

How to check wether or not a method is called by a child?

The child Class extends a parent Class.
The parent Class has some code I don't want to execute in onCreate().
How can I do this?
Parent:
public class MainActivity extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        if (!child)
        {
                ... more code ...
        }
    }
}

Child:
public class SingleArticulo extends MainActivity {
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_single_articulo);

        ... other code ...
    }
}

A:

Use the Template Method pattern.
Base class:
public class MainActivity extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        this.doMoreOnCreate()
    }

    protected void doMoreOnCreate() {
                ... more code ...
    }
}

Child:
public class SingleArticulo extends MainActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_single_articulo);

        ... other code ...
    }

    @Override
    protected void doMoreOnCreate() {
    }
}

