android-appcompat

How to setContentView before super.onCreate while using AppCompat v22.1.0?

旧巷老猫 提交于 2020-01-24 05:01:04
问题 Hey I've just upgraded my app to AppCompat v22.1.0 and got this exception Caused by: java.lang.IllegalArgumentException: AppCompat does not support the current theme features at android.support.v7.app.AppCompatDelegateImplV7.ensureSubDecor(AppCompatDelegateImplV7.java:360) at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:246) at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:106) I found soln. here https:/

Difference between Android Framework widgets and their AppCompat version

好久不见. 提交于 2020-01-23 05:35:11
问题 I have lately noticed that there are AppCompat versions of most View types in Android, for example ListView / ListViewCompat , Button / AppCompatButton etc. For these more simple Views (not counting for example SwitchCompat), what are the difference between them and the Android Framework version? I have not found any documentation on this matter... I'm interested in knowing the consequences of choosing either version and if there are any advantages in chosing one over the other. Specifically:

Theme not applied using appcompat library on some Android 4.X devices

醉酒当歌 提交于 2020-01-22 17:57:12
问题 After updating the appcompat library to the latest version (v21) to apply the material design, my custom theme isn't used anymore on Android 4.0.X devices unless I explicitly declare it in the XML. I have tested the theme on Android 2.3.X and 5.0.0 devices and it works on those devices. But it's not working on my HTC One S with Android 4.0.3. What do I need to do to fix this? My themes.xml <style name="Theme.Custom" parent="@style/Theme.AppCompat.Light"> <item name="android:editTextStyle">

Cannot resolve symbol 'Theme.AppCompat.Light.DarkActionBar' in styles.xml

时光怂恿深爱的人放手 提交于 2020-01-22 05:13:06
问题 Theme.AppCompat.Light.DarkActionBar is not compiling in styles.xml. I have added compile 'com.android.support:appcompat-v7:25.1.0' in app module's build.gradle . I have searched for solution in google. A lot of them are about changing the classpath in Project's build.gradle .Still its showing the same error. build.gradle dependencies { compile 'com.android.support:appcompat-v7:25.1.0' compile 'com.android.support:design:25.1.0' compile 'com.android.support:support-annotations:25.1.0' compile

How can I use vectorDrawable as icon for push notifications using Android Support Library 23.2? setSmallIcon gives error

与世无争的帅哥 提交于 2020-01-21 12:15:15
问题 My app is under API < v21, so I use Android Support Library 23.2 for managing my vectorDrawables. android { defaultConfig { vectorDrawables.useSupportLibrary = true } } All views works ok exept icon for push notification: NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this) .setColor(getResources().getColor(R.color.colorAccent)) .setSmallIcon(R.drawable.ic_play_arrow_white_24dp) //ERROR .setContentTitle(getString(R.string.app_name)) .setContentText(getString(R.string

How can I use vectorDrawable as icon for push notifications using Android Support Library 23.2? setSmallIcon gives error

戏子无情 提交于 2020-01-21 12:15:07
问题 My app is under API < v21, so I use Android Support Library 23.2 for managing my vectorDrawables. android { defaultConfig { vectorDrawables.useSupportLibrary = true } } All views works ok exept icon for push notification: NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this) .setColor(getResources().getColor(R.color.colorAccent)) .setSmallIcon(R.drawable.ic_play_arrow_white_24dp) //ERROR .setContentTitle(getString(R.string.app_name)) .setContentText(getString(R.string

Null Pointer exception in using support library share action provider

时光总嘲笑我的痴心妄想 提交于 2020-01-21 04:09:26
问题 Below is the code of my Activity . In this I am using the support library appcompat import android.content.Intent; import android.os.Bundle; import android.support.v4.view.MenuItemCompat; import android.support.v7.app.ActionBarActivity; import android.support.v7.widget.ShareActionProvider; import android.view.Menu; import android.view.MenuItem; public class MainActivity extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState

Use Tab with new ToolBar (AppCompat v7-21)

ぃ、小莉子 提交于 2020-01-18 04:10:27
问题 I was using SupportActionBar with tabs and a custom ActionBar theme (created with http://jgilfelt.github.io/android-actionbarstylegenerator/), that show the tabs only when the user expands the search view. public boolean onMenuItemActionExpand(MenuItem item) { actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); return true; } } I migrated from ActionBar to Toolbar. My app really needs to support API 9. Is there a way to use this code to add the tabs back?: Toolbar toolbar = (Toolbar)

How can I resolve actionbarSherlock conflict with appcompat? [closed]

巧了我就是萌 提交于 2020-01-16 18:29:52
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 4 years ago . I have an old app, builds with actionbarSherlock and appcompact. I have import the project from eclipse to gradle, but when I compile the project the shell shows me a lot of errors that warnsme that there are duplicates. Like this: Error: Attribute "subtitleTextStyle" has already been defined. How

Cannot get an R.java file to generate after importing AppCompat v7 into Eclipse

﹥>﹥吖頭↗ 提交于 2020-01-16 03:45:13
问题 I have been grinding at this for hours on end. I seem to do everything right according to google and other answers to this same question, yet I still get no R.java file in my project. I appear to not have any errors in any of my resources. as soon as I remove the library reference in my project, the R file is generated again. The errors in the project are simply due to the lack of an R.java file. 回答1: Please check the console section. Sometimes there is a JAR mismatch. The JAR in the library