I want to extend both AppCompatActivity, Fragment activity because I use this code
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
My Java file wants to extend AppCompatActivity but I'm using map in that Activity so it already extends FragmentActivity
Since Java does not not support multiple inheritance, are there any interfaces instead of AppCompatActivity or FragmentActivity I can use?
AppCompatActivity
is a subclass ofFragmentActivity
. So you can useAppCompatActivity
in place ofFragmentActivity
.If you do not want to use
AppCompatActivity
, usesetActionBar(toolbar)
instead ofsetSupportActionBar(toolbar)