Search Unity

Multiple Inheritance Problem extending UnityPlayerActivity

Discussion in 'Android' started by kalathos16, Sep 23, 2016.

  1. kalathos16

    kalathos16

    Joined:
    Aug 17, 2016
    Posts:
    5
    Hi, the problem is that in my Android app I have one class that extends ActionBarActivity, because I need to use getSupportActionBar() and getSupportFragmentManager() methods.
    But, this class has too a method which is called from other Unity app, and this method cannot be placed in any other activity-class, so I need this class extending UnityPlayerActivity too.

    What Can I do?
     
  2. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    You can probably derive your new activity from ActionBarActivity, make sure you implement the relevant bits that load the engine, etc.

    You can get the source for UnityPlayerActivity under this path:
    [Unity]\Editor\Data\PlaybackEngines\AndroidPlayer\Source\com\unity3d\player
     
  3. kalathos16

    kalathos16

    Joined:
    Aug 17, 2016
    Posts:
    5
    Thanks, but what do you mean? To modify the original UnityPlayerActivity.java for extending ActionBar and then extend this UnityPlayerActivity in the android class?