android-support-library

Android Activity transitions using Support v4 up to date with Android L

好久不见. 提交于 2019-12-04 09:21:48
问题 I was implementing material design for my app. I saw that it is possible to make transitions between activities just here: http://android-developers.blogspot.com.es/2014/10/implementing-material-design-in-your.html So i tried to follow what "Authentic motion" section says: ActivityMain.java Intent intent = new Intent(); String transitionName = getString(R.string.transition_album_cover); … ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation(activity,

PreferenceFragmentCompat custom layout

北战南征 提交于 2019-12-04 09:14:12
问题 I need a custom layout for my PreferenceFragmentCompat. In the docs for PreferenceFragmentCompat it seems that you can possibly inflate and return a view in onCreateView(). However a NPE results:- Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v7.widget.RecyclerView.setAdapter(android.support.v7.widget.RecyclerView$Adapter)' on a null object reference at android.support.v7.preference.PreferenceFragmentCompat.bindPreferences

How to define v7 appcompat dependency correctly?

痴心易碎 提交于 2019-12-04 09:08:49
问题 I'm trying to get an (inherited) Android project to build. I'm using Ant & command line tools (and IDEA). In styles.xml, there are references that cannot be resolved such as: <style name="AppBaseTheme" parent="@style/Theme.AppCompat.Light"> This is the original error I ran into: [...]/res/values/styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name '@style/Theme.AppCompat.Light'. I then noticed that project.properties has this appcompat reference

In a snackbar action, how can I be sure it's safe to permanently delete a soft-deleted record from the database?

假如想象 提交于 2019-12-04 08:57:46
问题 I am using Snackbar in android and I have implemented an action so that user can undo the action (the action is clearing all the items in the listview).Removing and adding the items back to the listview has already been done and working fine. My issue is that, items are stored in sqlite database and how can I delete the items from tables? (How can I know that the user has not clicked the undo button, so that I can completely remove the data from database). This is the code inside

How can I get menu item in NavigationView?

半世苍凉 提交于 2019-12-04 08:48:26
问题 <android.support.design.widget.NavigationView android:id="@+id/drawer_nav" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="start" android:theme="@style/Theme.AppCompat.Light.NoActionBar" app:headerLayout="@layout/drawer_header" app:menu="@menu/menu_drawer" /> I am using android.support.design.library for material design. What I want is to hide some menu items when the user is not logged-in. Now I have trouble to get the menu item in

Application crashes on rotation without stackTrace

陌路散爱 提交于 2019-12-04 08:17:28
I'm having a very strange problem with my app, which consists of an Activity and 2 Fragments (android.support.v4.app.Fragment). The problem is when I rotate my tablet : the app crashes right away. A few days before, everything was working fine, but I had to change packages name, that threw a few errors but I manage to correct them. Problem appeared right after that, but I just can't find where is the error. Here is the Logcat I get right after the app is destroyed, restarted, resumed and created : 10-08 17:00:14.930: D/dalvikvm(18155): GC_CONCURRENT freed 394K, 8% free 7792K/8455K, paused 1ms

Android Support Library v17

☆樱花仙子☆ 提交于 2019-12-04 07:57:20
I just downloaded Eclipse 4.4 Luna and installed the latest ADT 20 on it. Now, new templates for new Android Project are included. One of them is "Android TV Activity". The existing code uses Android Support Library v17!! import android.content.Context; import android.graphics.Bitmap; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.support.v17.leanback.widget.ImageCardView; import android.support.v17.leanback.widget.Presenter; import android.util.Log; import android.view.View; import android.view.ViewGroup; But I cannot find the new

Android issue with implementing flings in NestedScrollView

拥有回忆 提交于 2019-12-04 07:53:59
I'm having a bit of an issue using NestedScrollView . My use case uses 2 NestedScrollView , a parent and a child. I have overridden the parent's onNestedPreScroll method to sometimes consume scroll pixels before the child: @Override public void onNestedPreScroll(View target, int dx, int dy, int[] consumed) { if (dy > 0 && getScrollY() < getScrollRange()) { int oldScrollY = getScrollY(); scrollBy(0, dy); consumed[1] = getScrollY() - oldScrollY; } } I have also overridden the parent's onNestedPreFling to consume fling before the child: @Override public boolean onNestedPreFling(View target, float

After the rotate, onCreate() Fragment is called before onCreate() FragmentActivity

百般思念 提交于 2019-12-04 07:36:37
问题 I'm using FragmentActivity and Fragments. When the application starts: FragmentActivity onCreate() <------ FragmentActivity onStart() FragmentActivity onResume() Fragment onAttach() Fragment onCreate() <------ Fragment onCreateView() Fragment onActivityCreated() Fragment onStart() Fragment onResume() Everything is OK, FragmentActivity onCreate() is called before Fragment onCreate(). And when I rotate: Fragment onPause() FragmentActivity onPause() Fragment onStop() FragmentActivity onStop()

NotificationCompat cannot be resolved to a type

杀马特。学长 韩版系。学妹 提交于 2019-12-04 07:18:22
I am newer to Android and receive the error message: "NotificationCompat cannot be resolved to a type" MinSDK=9, TargetSDK=18, As of yet, all sources are very vague on how to resolve this issue and simply note: "update the JAR files". What JARs do I need and where can I find them, so that this issue is resolved? You need the support library. Here are the instructions on how to download them: http://developer.android.com/tools/support-library/setup.html I needed to add "android-support-v4.jar" to my project to use the ActionBar . Sometimes Eclipse gets hung up on this class, and no amount of