android-appcompat

Why does Eclipse automatically add appcompat v7 library support whenever I create a new project?

吃可爱长大的小学妹 提交于 2019-12-17 02:28:28
问题 Why does Eclipse automatically add appcompat v7 library support whenever I create a new project? I am creating a simple project whose MainActivity should extend Activity , but it does not. Eclipse automatically adds action bar support. How do I create a simple project without the appcompat library? FYI, I have downloaded the latest version of ADT with everything updated recently. I am using Window 7 x64. 回答1: As stated in Android's Support Library Overview, it is considered good practice to

NoClassDefFoundError: android.support.v7.internal.view.menu.MenuBuilder

妖精的绣舞 提交于 2019-12-17 01:33:12
问题 There is an issue with the Android appcompat v7 library on Samsung devices running Android 4.2. I keep getting crashes with the following stack trace in my Developer Console: java.lang.NoClassDefFoundError: android.support.v7.internal.view.menu.MenuBuilder at android.support.v7.widget.PopupMenu.<init>(PopupMenu.java:66) at com.[my-package-name].CustomActivity$5.onClick(CustomActivity.java:215) at android.view.View.performClick(View.java:4222) at android.view.View$PerformClick.run(View.java

How to set background image in actionbar android [closed]

余生颓废 提交于 2019-12-14 04:23:45
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 4 years ago . I'm a new Android developer. How to setting background image in actionbar android. I can add image background within my actionbar. but cant scaling my image. My style <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> </style> MainActivity @Override protected

Contextual Action Mode not filtering touches

北慕城南 提交于 2019-12-14 03:46:50
问题 The contextual action mode, when overlayed on top of an android.support.v7.widget.Toolbar, does not appear to filter touches over its entire width, but lets touches "fall through" to (invisible) widgets on the Toolbar. My Toolbar contains a custom widget (one of the declared benefits of Toolbar). I have the contextual action mode styled to overlay the toolbar, and it hides it entirely. However, when I touch where the (now obscured) custom widget was located, the touch passes through to it. I

Navigation drawer with AppCompat and normal actionbar?

自作多情 提交于 2019-12-13 20:03:06
问题 I have currently, a navigation drawer, a actionbar(no toolbar), and in the styles i defined as parent Theme.AppCompat.Light . I want to stay at actionbar, but when i use that parent, i become the following error: "Attempt to invoke virtual method 'android.content.Context android.app.ActionBar.getThemedContext()' on a null object reference" in that code: mDrawerListView.setAdapter(new ArrayAdapter<String>( getActionBar().getThemedContext(), R.layout.navdrawer_item_row, android.R.id.text1, new

Android Support v7 Toolbar setTitleTextAppearance not working

巧了我就是萌 提交于 2019-12-13 18:34:51
问题 I am trying to change the font of the toolbar's title. Here is my toolbar layout: <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/toolbar" android:layout_height="wrap_content" android:layout_width="match_parent" android:minHeight="?attr/actionBarSize" android:background="#666666" app:titleTextAppearance="@style/MyText" app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"/>

Resources$NotFoundException for ImageView with vector drawable

杀马特。学长 韩版系。学妹 提交于 2019-12-13 14:25:51
问题 I've got crash - Resources$NotFoundException for a vector drawable upon activity creation. Crashes on pre-21. Android Studio 2.1 Support library 24.0.0 Gradle plugin 2.1.0 targetSdk 23 minSdk 15 buildToolsVersion 23.0.2 Debugging on emulator sdk 16 in the app module build.gradle i have: vectorDrawables.useSupportLibrary = true The activity is a subclass of AppCompatActivity . The fragment is a subclass of a support Fragment . In the activity I'm calling: static { AppCompatDelegate

Android - Should pass resolved color instead of resource id here: `getResources().getColor(R.attr.colorPrimary)`

家住魔仙堡 提交于 2019-12-13 12:42:58
问题 I am following this tutorial Flexibal Space with Image For design pattern for a toolbar called Flexibal Space with Image in android. While using Palette here I am stuck in following error in java file causing application to crash. Should pass resolved color instead of resource id here: `getResources().getColor(R.attr.colorPrimary)` Follwing is my java file YoutubeActivity.java public class YoutubeActivity extends AppCompatActivity { Toolbar toolbar; CollapsingToolbarLayout collapsingToolbar;

Customizing spinners' spacing

夙愿已清 提交于 2019-12-13 11:44:37
问题 Spinners provide two states. The first and default state ( state A ) shows the currently selected value. The second ( state B ) shows a dropdown menu when the spinner display is touched. By default a left padding is added to the items displayed in state A and B. I would like to remove it when the current selected value is displayed ( state A ) but to keep it when items are displayed in the dropdown menu ( state B ). Since the padding is set with the CheckedTextView used in the layout that is

How to use preferences in Android support library v7 rev23?

江枫思渺然 提交于 2019-12-13 11:25:52
问题 In my app using support library v7 I want to add a preference screen. Since Google provides absolutely no documentation on that subject I have looked up a post found elsewhere here on Stack Overflow. So this is my project: activity_preferences.xml <?xml version="1.0" encoding="UTF-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:support="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android