android-support-library

CollapsingToolbarLayout sometimes leaves white space below [duplicate]

十年热恋 提交于 2019-12-08 15:45:19
问题 This question already has an answer here : CollapsingToolbarLayout doesn't work well with NestedScrollView (1 answer) Closed 11 months ago . I have a problem. Here are the screenshots: And here is the code: <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/drawerLayout" android:layout_width="match_parent" android:layout_height="match

Import new Android Design Support library

喜夏-厌秋 提交于 2019-12-08 15:07:57
问题 Hi i'am trying to import the new android support library like this com.android.support:support-design:22.0.0 but i got this error after sync the gradle : failed to find 回答1: You have to update your Android Support Repository in SDK Manager, then just add this dependency to your build.gradle : compile 'com.android.support:design:22.2.0' com.android.support:support-design:22.0.0 is wrong. 回答2: dependencies { implementation 'com.android.support:design:28.0.0' } 回答3: The docs has it wrong. It

How to fix “Support-v13:19.1.0 depends on libraries but is not a library itself”?

a 夏天 提交于 2019-12-08 14:50:48
问题 I just launched a project in Android Studio 0.8.1 for the first time since upgrading from 0.6.2. The error thrown is "Error:Module version com.android.support:support-v13:19.1.0 depends on libraries but is not a library itself". Does anyone have an idea why this is? I have installed some of the new API20 stuff to play with Android L, but the buildTools for this project are still set to 19.1.0. Here's the dependencies section of my build.gradle: dependencies { compile fileTree(dir: 'libs',

AppCompatActivity cannot be resolved to a type

眉间皱痕 提交于 2019-12-08 13:02:41
问题 I am trying to add Theme to my project. It requires appcompat v7. I added the support library according to the steps mentioned in the Android developer website. After searching a lot I came to know that support library v4 will conflict with support library v7. So I removed the android library v4 from my project. Because of that now I got the NotificationCompa t error( import android.support.v4.app.NotificationCompat; import android.support.v4.app.NotificationCompat.Builder; ). What I have to

Fragment setRetainInstance not works (Android support lib) [duplicate]

你离开我真会死。 提交于 2019-12-08 12:08:51
问题 This question already has answers here : Closed 6 years ago . Possible Duplicate: Android fragments setRetainInstance(true) not works (Android support library) I wrote a simple test project, but I cant understand why I always receive savedInstanceState = null in lifecycle methods onCreate, onCreateView and onActivityCreated. I change the screen orientation, see the log, but state not saved. Tell me please where is my mistake. Thanks. The code of fragment class is: public class TestFragment

Swapping fragments in a viewpager

情到浓时终转凉″ 提交于 2019-12-08 09:30:55
问题 I have a ViewPager with 3 Fragments and my FragmentPagerAdapter: private class test_pager extends FragmentPagerAdapter { public test_pager(FragmentManager fm) { super(fm); } @Override public Fragment getItem(int i) { return fragments[i]; } @Override public long getItemId(int position) { if (position == 1) { long res = fragments[position].hashCode()+fragment1_state.hashCode(); Log.d(TAG, "getItemId for position 1: "+res); return res; } else return fragments[position].hashCode(); } @Override

FragmentManager.findFragmentByTag returns null

喜你入骨 提交于 2019-12-08 07:35:37
问题 I'm using Android Support Library (v4) and ActionBarSherlock. I'm trying to close a progress dialog programatically. I've coded a small utility class to help with dialog management. The dialog is shown from an AsyncTask.onPreExecute . It gets displayed correctly. Then I fire a config change by rotating the device, which destroys the activity (onDestroy calls AsyncTask.cancel(true) ). AsyncTask.onCancelled is called, and is in this method where I'm trying to close the dialog. But nothing

Why the fragment overlaps the Action bar?

五迷三道 提交于 2019-12-08 05:10:31
I tried to use the android support library v7 to add an action bar to my activity my extending tht actionbar activity. A blank fragment has been also built to make a tab. However, the content of the fragment is overlapping the action bar. How can I fix it? Vivek Mishra I read it here ActionBar with support library and Fragments overlay content I am sure it will help you : For pre ICS devices you must use: R.id.action_bar_activity_content instead of android.R.id.content R.id.action_bar_activity_content is a new id used in layout for displaying app content, it would appear that it replace

How to align message textview to the center in snackbar?

不羁岁月 提交于 2019-12-08 02:41:27
问题 How to align message textview to the center Horizontally in snackbar in android? 回答1: Below is a sample, for making the Snackbar Text center horizontal Snackbar snackbar = Snackbar.make(findViewById(R.id.coordinatorLayout), "Hello", Snackbar.LENGTH_SHORT); snackbar.show(); View view = snackbar.getView(); TextView txtv = (TextView) view.findViewById(android.support.design.R.id.snackbar_text); txtv.setGravity(Gravity.CENTER_HORIZONTAL); 回答2: Try to set both textAlignment and Gravity to the

Can't add LocalBroadcastManager to project in Android Studio

╄→гoц情女王★ 提交于 2019-12-08 02:07:46
问题 I think I've tried everything now... I've been all over stack overflow, I've even consulted the android doc Most of the posts here show how to add the .jar file in Eclipse "android tools -> add support library" or something So I've tried to do it how the doc tells me, by going to build.gradle, and adding compile 'com.android.support:support-v4:19.0.0' to the dependencies but even if I add it, and rebuild the project, I still can't import android.support.v4.content.LocalBroadcastManager ... it