android-actionbaractivity

My MainActivity class throws java.lang.ClassNotFoundException when extends ActionBarActivity

巧了我就是萌 提交于 2019-11-30 20:44:04
问题 I followed the instructions indicated in other threads on how to import external libraries, but after importing android-support-v7-appcompat.jar into the Referenced Libraries of my Android project (in ADT v.22.0.5) I get java.lang.ClassNotFoundException: import android.os.Bundle; import android.support.v7.app.ActionBar; import android.support.v7.app.ActionBarActivity; import android.view.Menu; public class MainActivity extends ActionBarActivity { @Override protected void onCreate(Bundle

AppCompat v7 Toolbar Up/Back Arrow Not Working

橙三吉。 提交于 2019-11-30 20:41:29
I have two fragments in an activity. When fragment A is showing, I want the navigation drawer burger icon to show and the navigation drawer to work. When fragment B is showing, I want the back arrow to show and when it's clicked do an up navigation. However, I can't seem to get the new AppCompat v7 toolbar to show the up arrow at all inside my ActionBarActivity unless the nav drawer is open. In my activity, for my onCreate() method I have... toolbar = (Toolbar) findViewById(R.id.toolbar); if (toolbar != null) { setSupportActionBar(toolbar); } mDrawerLayout = (DrawerLayout) findViewById(R.id

Unable to change Appcompat theme from light to holo dark

若如初见. 提交于 2019-11-30 17:47:43
I am trying to change the theme of my app completely, This is what I modified & tried : styles.xml in values folder is <resources> <!-- Base application theme, dependent on API level. This theme is replaced by AppBaseTheme from res/values-vXX/styles.xml on newer devices. --> <style name="AppBaseTheme" parent="android:Theme.Holo"> <!-- Theme customizations available in newer API levels can go in res/values-vXX/styles.xml, while customizations related to backward-compatibility can go here. --> </style> <!-- Application theme. --> <style name="AppTheme" parent="AppBaseTheme"> <!-- All

How does one remove default Toolbar menu items and replace with different icons?

笑着哭i 提交于 2019-11-30 07:31:21
I am using a toolbar from v7.widget.Toolbar support library and v7.app.ActionBarActivity. When the onCreateOptionsMenu is inflated on the toolbar, I see a standard "Back" arrow on the leftmost side of the toolbar and standard "Overflow" dots on the rightmost portion of the toolbar. I would like to hide or disable these default icons and replace with another set of Android recommended icons. Any ideas on how to fix? MyActiviy.java: public class MyActivity extends ActionBarActivity { private Toolbar toolbar; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate

AppCompat v7 Toolbar Up/Back Arrow Not Working

倾然丶 夕夏残阳落幕 提交于 2019-11-30 04:46:41
问题 I have two fragments in an activity. When fragment A is showing, I want the navigation drawer burger icon to show and the navigation drawer to work. When fragment B is showing, I want the back arrow to show and when it's clicked do an up navigation. However, I can't seem to get the new AppCompat v7 toolbar to show the up arrow at all inside my ActionBarActivity unless the nav drawer is open. In my activity, for my onCreate() method I have... toolbar = (Toolbar) findViewById(R.id.toolbar); if

ActionBarActivity with ActionBarDrawerToggle - Not using drawerImageRes

老子叫甜甜 提交于 2019-11-30 03:39:49
Working from this android example, I've attempted to create an app that uses the support version (android.support.v4 and android.support.v7). The example creates a menu drawer that looks like this and my code gets this Notice the icon is different and the way it moves is different, well in my version it doesn't move. Example code public class MainActivity extends Activity { private DrawerLayout mDrawerLayout; private ListView mDrawerList; private ActionBarDrawerToggle mDrawerToggle; private CharSequence mDrawerTitle; private CharSequence mTitle; private String[] mPlanetTitles; @Override

Unable to change Appcompat theme from light to holo dark

僤鯓⒐⒋嵵緔 提交于 2019-11-30 01:46:04
问题 I am trying to change the theme of my app completely, This is what I modified & tried : styles.xml in values folder is <resources> <!-- Base application theme, dependent on API level. This theme is replaced by AppBaseTheme from res/values-vXX/styles.xml on newer devices. --> <style name="AppBaseTheme" parent="android:Theme.Holo"> <!-- Theme customizations available in newer API levels can go in res/values-vXX/styles.xml, while customizations related to backward-compatibility can go here. -->

How does one remove default Toolbar menu items and replace with different icons?

放肆的年华 提交于 2019-11-29 09:43:01
问题 I am using a toolbar from v7.widget.Toolbar support library and v7.app.ActionBarActivity. When the onCreateOptionsMenu is inflated on the toolbar, I see a standard "Back" arrow on the leftmost side of the toolbar and standard "Overflow" dots on the rightmost portion of the toolbar. I would like to hide or disable these default icons and replace with another set of Android recommended icons. Any ideas on how to fix? MyActiviy.java: public class MyActivity extends ActionBarActivity { private

ActionBarActivity with ActionBarDrawerToggle - Not using drawerImageRes

扶醉桌前 提交于 2019-11-29 01:09:47
问题 Working from this android example, I've attempted to create an app that uses the support version (android.support.v4 and android.support.v7). The example creates a menu drawer that looks like this and my code gets this Notice the icon is different and the way it moves is different, well in my version it doesn't move. Example code public class MainActivity extends Activity { private DrawerLayout mDrawerLayout; private ListView mDrawerList; private ActionBarDrawerToggle mDrawerToggle; private

App crashes when extending ActionBarActivity

こ雲淡風輕ζ 提交于 2019-11-28 05:20:39
问题 I have an error catch when I extend ActionBarActivity . If I extend Activity there is no errors. The thing is in my other activities it works perfectly. At first, I thought it's was because my previous activity put extras in the intent. But even without it the app crash. Here is my code : import android.support.v7.app.ActionBarActivity; import android.os.Bundle; public class FullscreenActivity extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { super