android-support-library

Android Studio Support Library v7

寵の児 提交于 2019-12-21 21:38:02
问题 I am attempting to use the Support Action Bar. I have followed all the instructions on how to include the support library in Android Studio v 0.3.0. My build.gradle's dependencies look like: dependencies { compile fileTree(dir: 'libs', include: '*.jar') compile project(':NineOld') compile project(':Helpshift') compile project(':SlidingMenu:library') compile project(':AmbilWarna') compile 'com.android.support:support-v4:18.0.+' compile 'com.android.support:appcompat-v7:18.0.+' } When I attempt

fragment popbackstack behaviour broken in 25.1.0 and 25.1.1

耗尽温柔 提交于 2019-12-21 21:26:25
问题 Since support version 25.1.0 and the most recent 25.1.1 I got strange behaviour with fragment replacing/adding. There have been issues reported for 25.1.0 Android - fragmentTransaction.replace() not works on support library 25.1.0 But now in 25.1.1 i got similar issues. To reproduce the behaviour i created sample app which you can find at https://github.com/holoduke/fragmenttest It is basically one Activity with a fragment container. A couple of fragments are available which will be

Is TabLayout supposed to replace PagerTabStrip? Is there any “pro” to PagerTabStrip?

懵懂的女人 提交于 2019-12-21 21:25:59
问题 OK, so I see PagerTabStrip has a bug - https://code.google.com/p/android/issues/detail?id=183127 Therefore, is TabLayout a better choice especially for now? Is there any downside to TabLayout? Some quirkiness where you might have to set all 3 items? I see TabLayout versus pagerTabStrip for convenience and functionality but that didn't really get answers... 来源: https://stackoverflow.com/questions/32770917/is-tablayout-supposed-to-replace-pagertabstrip-is-there-any-pro-to-pagertabst

How to add Snackbars in a BroadcastReceiver?

ぃ、小莉子 提交于 2019-12-21 20:01:11
问题 Snackbars provide lightweight feedback about an operation by showing a brief message at the bottom of the screen. Snackbars can contain an action. Android also provides a toast, primarily used for system messaging. Toasts are similar to snackbars but do not contain actions and cannot be swiped off screen. My question import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.widget.Toast; public class TestReceiver extends

Blurry Image on API 21+ : AppCompat v23.2.0 using VectorDrawables with srcCompat

耗尽温柔 提交于 2019-12-21 19:40:07
问题 I have an image display issue on API 21+, but everything works fine on lower devices and API 22+. I'm using Gradle Plugin 1.5, so my build.gradle look like this: // Gradle Plugin 1.5 android { defaultConfig { generatedDensities = [] } // This is handled for you by the 2.0+ Gradle Plugin aaptOptions { additionalParameters "--no-version-vectors" } } Image View in XML: <ImageView android:id="@+id/landing_img_slide" android:layout_width="225dp" android:layout_height="225dp" android:layout

ActionBarActivity catch an error on Phone

我的梦境 提交于 2019-12-21 17:31:23
问题 ** I was recomended to use ActionBar Activity** Here is the previous code import android.support.v7.app.ActionBar; import android.support.v7.app.ActionBarActivity; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } I wrote new application and followed advice. import android.os.Bundle; import android.support.v7.app.ActionBar; import android.support.v7.app

Android Support Library v17

旧街凉风 提交于 2019-12-21 13:48:34
问题 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

NotificationCompat cannot be resolved to a type

断了今生、忘了曾经 提交于 2019-12-21 12:43:13
问题 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? 回答1: 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

getSupportActionBar() returns null with Robolectric

不问归期 提交于 2019-12-21 12:09:20
问题 The method getSupportActionBar() returns null when i invoke it through a Test Case based in Roboelectric and JUnit. This is my simple test case: package com.mobile.test; import static org.hamcrest.CoreMatchers.equalTo; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertThat; import org.junit.Test; import org.junit.runner.RunWith; import org.robolectric.Robolectric; import org.robolectric.RobolectricTestRunner; import android.app.Activity; import android.content

The hierarchy of the type activity is inconsistent when extending ActionBarActivity

有些话、适合烂在心里 提交于 2019-12-21 09:15:08
问题 Hi I've got new v7 support library with appcompat actionbar and when I want to extend from ActionBarActivity as documented here, eclipse show me this error The hierarchy of the type testActivity is inconsistent and when I move my courser on ActionBarActivity class it says The type android.support.v4.app.TaskStackBuilder$SupportParentable cannot be resolved. It is indirectly referenced from required .class files now how can I Solve this issue? 回答1: you should use new support v4 library that