Aren't the list items children of the ListView? Yes, when the ListView creates them via the associated ListAdapter. The empty view is not a list item. It is not a child of the ListView. It is simply another view. AdapterView toggles the visibility of itself and the empty view,...

Edit: Snackbar is now part of the new Android Support Design library. You should drop the third party library you are using for it Old answer you have to call .setIndeterminate(true) before calling show() final SnackBar tmp = new SnackBar(ActSplash.this, "Do you want change color of this button to red?",...

I don't have experience with ParseQueryAdapter, but from reading up on it, it seems you could do something like this. First, create your own class that extends ParseQueryAdapter, and override getViewTypeCount(): public class MyParseAdapter extends ParseQueryAdapter<ParseObject> { public MyParseAdapter(Context context, QueryFactory<ParseObject> clazz){ super(context, clazz); } @Override public int getViewTypeCount() {...

Yes . I too had the same issues. The effect is purely dependent on the dimension of the object. for eg a 512*512 image gave me perfect circled ripple effect and a rectangular button on the bottom of the screen gave me oval/ellipsed effect. so i added a small square...

this is how i solved the problem first i created a new class like this public class MyParseAdapter extends ParseQueryAdapter<ParseObject> { public MyParseAdapter(Context context, QueryFactory<ParseObject> clazz) { super(context, clazz); } @Override public int getViewTypeCount() { return 1; } } and i replaced every ParseQueryAdapter with MyParseAdapter even the declaration try...

Instead of using px and sp you have to use dp/dip. It is not become bigger according to phone default styles and resolution or for version > 19. This practice will be help you for consistent views. ...

From the documentation for AnimationDrawable, The simplest way to create a frame-by-frame animation is to define the animation in an XML file, placed in the res/drawable/ folder, and set it as the background to a View object. Then, call start() to run the animation. You need to call start() to...

The problem is that you're using the YouTubePlayerView, which requires your Activity to extend YouTubeBaseActivity. Then you changed your activity, so that it now extends AppCompatActivity. This breaks YouTubePlayerView. The solution is pretty simple: use the YouTubePlayerFragment class. This does not pose any requirement on the Activity, leaving you with...

Thank you all for your response, but I solved it by my own. Earlier I was implementing the dialog using the Dialog class, which was causing the problems. Dialog mDialog= new Dialog(getActivity(),android.R.style.Theme_Dialog); mDialog.requestWindowFeature(Window.FEATURE_NO_TITLE); mDialog.setContentView(R.layout.mylayout); I have even tried changing the themes but it didn't help. Then I tried using DialogFragment,...

No, there is no way to do that using the circular reveal animator. You'd have to make your own to soften the edges, but the performance is likely to be horrible. The typical circular reveal is very fast and it is difficult to see the hard edges....

It's impossible. User should choose directory using android's file picker. The only way to get access to folder is using: Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE); startActivityForResult(intent, 42); Because file is provided by Storage Access Framework DocumentsProvider. Actually it could return some Uri from 3-rd party app, which is not real...

If you want to add the item in the overflow menu you should set never as android:showAsAction. If you set always the item will be an icon in the toolbar. Edit your menu.xml like this: <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <item android:id="@+id/action_settings" android:orderInCategory="100" android:title="@string/action_settings" android:showAsAction="never" android:visible="true" /> </menu> Also you need to...

The short answer: not really and according to the Material guidelines (AFAIK) you shouldn't delay the onClick execution in such a way. In my opinion it would result in pretty poor UX - I like my buttons snappy and I don't like waiting for fancy animations. The medium-length semi-answer: you...

The toString() method doesn't actually convert the contents of a byte array to a String. It returns "a string representation of the object". In this case, '[[email protected]' means "the byte array whose hashcode is 1391fd8d" - not very useful is it? You can convert a byte[] to a String by...

One bug is how you created the RSAPublicKeySpec: new RSAPublicKeySpec(new BigInteger(modulusBytes), new BigInteger(exponentBytes)); In case the first bit of the modulusBytes or exponentBytes is one the number will be interpreted as negative value. When you work with RSA numbers and BigInteger always use the constructor BigInteger (int signum, byte[] magnitude)...

I'm not sure if there are better ways to solve this from a Maven point of view, but since the question was where you can download the android.jar artifact, here's a solution to that. You can download the stand-alone Android SDK tools and then use SDK Manager to download your...

The PendingIntent needs to point to either a BroadcastReceiver or a service that can act on the specified request. For example with a BroadcastReceiver you would have a pending intent that looks like public static final String ACTION_PAUSE = "com.pkg.name.ACTION_PAUSE"; mPauseIntent = PendingIntent.getBroadcast(mService, REQUEST_CODE, new Intent(ACTION_PAUSE).setPackage(pkg), PendingIntent.FLAG_CANCEL_CURRENT); Next, register...

After much testing, I went back to this line in the stacktrace and the clue was right in front of me: at android.support.v7.app.AppCompatActivity.onTitleChanged(Unknown Source) indicates that the parameter title could be null so the method setTitle(title) will cause the java.lang.AbstractMethodError at runtime. Of course, the error message is misleading since...

So after a few days of lots of research, and looking through GitHub, I finally managed to solve my problem. Steps to updating the ActionBar tabs to Toolbar tabs using AppCompatActivity: UPDATE: After Friday 29th May 2015: Thankfully, using a TabLayout with the Toolbar has become much simpler since the...

Consume the touch event in onInterceptTouchEvent() by returning true. I think it will do the job @Override public boolean onInterceptTouchEvent(MotionEvent event) { System.out.println("ENable?? "+isTabSwitchEnabled); // it prints out false or true based on what I have set if (this.isTabSwitchEnabled) { return super.onInterceptTouchEvent(event); } else { return true; } } ...

Unfortunately you can't use these APIs..and me neither.. The reason why you can't directly subclass the TrustAgentService is that it's hidden from SDK jars by the @SystemApi annotation. Furthermore the android.permission.BIND_TRUST_AGENT requires having the signature permission....

I finally fixed this! The android property clickable was set to false, but the click behaviour was performed in the ComboBoxView.java file on the following code: private final OnClickListener onClick = new OnClickListener() { @Override public void onClick(View v) { mSpinner.performClick(); } }; This was working everywhere (devices and emulators)...

When you create a new AVD and set up an SD Card, you add a primary external storage to the emulator. Android from version 4.4 prevents the modification of secondary external storage as you can see here: The WRITE_EXTERNAL_STORAGE permission must only grant write access to the primary external storage...

The HtcConsumerIr app doesn't work on Lollipop because it only uses the HTC library if you have KitKat. If you open ConsumerIrManagerCompat.java and change this line: if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT && hasPackage("com.htc.cirmodule", context)) { return new ConsumerIrManagerHtc(context); } else { return new ConsumerIrManagerBase(context); } to this: if (hasPackage("com.htc.cirmodule", context)) {...

Well the solution to my problem is a bit odd. I fixed it by simply renaming the drawable activation_bg to something_activation_bg. Please note that anything other than activation_bg was working, except activation_background which led to the same issue. I don't know why this is an issue specifically on the Lollipop...

By default, Material buttons are styled to show text in all-caps. However, there is a bug in the AllCapsTransformationMethod used for capitalization that causes it to discard Spannable data. You can override the default button styling and disable all-caps by specifying android:textAllCaps="false" on your Button. <Button ... android:textAllCaps="false" /> ...

as you can see from your own code ('setBackground') , you're setting the ripple as a BACKGROUND that's why it's being drawn on the background. ImageView on android API 21 added this "hack" for the ripple android:drawSelectorOnTop="true". But the library you're using didn't add the same hack to it. There's...

Okey I don't really fixed it for myself, but this only appears if you're using a samsung device with a custom rom based on cyanogenmod. It's only an error if get Device driver API mismatch. Try to ignore it or use a different device. It's not influencing your app. That's...

The issue is getting resolved by setting below value in webview. webView.getSettings().setTextZoom(100); Root cause: For Android OS < 5.0 TextZoom is having default value as 100. But in Lollipop OS, value is taken from font settings in device if it is not overwritten in application. If we are setting textZoom...

If you enable FLAG_TRANSLUCENT_STATUS you can draw under the status bar because it automatically set two other system UI visibility flags as explained in the documentation: public static final int FLAG_TRANSLUCENT_STATUS When this flag is enabled for a window, it automatically sets the system UI visibility flags SYSTEM_UI_FLAG_LAYOUT_STABLE and SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN....

It's an issue with Android webView. I had update for Android webView and i just updated it and it's working. So any one have same issue just update webView for particular device if update available. Thanks....

AFAIK, you can't, for obvious security reasons, except probably on rooted devices. Even the accessibility APIs don't support this AFAICT. Allowing arbitrary apps to fake input to other apps would be a major security hole. If your objective is to do this during testing, instrumentation testing allows you to simulate...

You can use this code this may help <android.support.v7.widget.CardView android:id="@+id/cardview" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="@dimen/margin_large" android:layout_marginRight="@dimen/margin_large" android:elevation="100dp" card_view:cardBackgroundColor="@android:color/white" card_view:cardCornerRadius="8dp"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical">...

That's shameful (but educational) that the following item tag: <style name="AppTheme" parent="Theme.ScannerTheme"> <item name="android:background">@drawable/bi_background</item> </style> Is the cause of all trouble, because ALL dialogs get the background because of the app's theme. The lesson is: beware what you put in your base theme definition......

I found a solution though I am not sure if others are willing to use it as it may harm the device and causes it to get useless In fact, as the answers that the question has received just sound to be copy and paste of other questions’ answers and...

Like you said, this is a known problem of the old SimpleAudioEngine with android 5.x. A new implementation was integrated into cocos2d-x 3.3 and onwards, and a patch was written for 2.x. You can get it and some more info here: http://blog.cocos2d-x.org/2015/04/performance-issue-caused-by-simpleaudioengine-on-android-5-0/...

You are accessing a Content Provider and can use it's API to register notification upon changes. Use the ContentResolver.registerContentObserver() method from activity, and supply the base Content URI for the provider and pass true for notifyForDescendents parameter, and your callback will get hit every time there's a change. getContentResolver().registerContentObserver(MediaStore.​Audio.Media.EXTERNAL_CONTENT_URI, true,...

MATCH '*foo*' queries never worked correctly in any version of sqlite. The fact that you got some results earlier was just a coincidence. Just the prefix form MATCH 'foo*' (and MATCH 'foo') are supported. Lollipop ships with a newer version of sqlite. For detailed list of changes between sqlite versions,...

You should be using the non-android namespaced properties with the support library: <style name="AppTheme" parent="Theme.AppCompat.Light"> <item name="colorPrimary">@color/primary</item> <item name="colorPrimaryDark">@color/primary_dark</item> <item name="colorAccent">@color/accent</item> </style> No v21 version required. This will give you consistent behavior back to API level 7...

The cause for this is a custom implementation of ResponseCache. When implementing CacheResponse.getHeaders(), you need to put the status line in the null key of the multimap. See: http://developer.android.com/reference/java/net/CacheResponse.html#getHeaders(). Failing to do so, causes okhttp to fail with a NullPointerException, which is a bug in okhttp. I'm copying the full...

I faced same problem in my app. Follow this link I hope you will solve this problem. And little bit explanation regarding your issue. Download and add gcm.jar in your project lib folder. And Add below code in your java class where you want to register. GCMRegistrar.checkDevice(this); GCMRegistrar.checkManifest(this); // Get...

It's a matter of timing, for example inserting your code in onCreate() would not crash the app on Samsung Galaxy S3 nor Nexus 7 2013 on Android 5.1. However, if you modify the code such that it's constantly updating the TextView: new Thread() { @Override public void run() { int...

The error is clear, since you are using ActionBarActivity so you need to use Theme.AppCompat or its descendant theme for this activity. or better use it for the whole application. Open your AndroidManifest.xml and edit one of these tags: Add android:theme="@style/Theme.AppCompat.Light" to application tag for applying this theme on all...

The transmit (TX) power of the OnyxBeacon, and as of any other BLE device that is iBeacon compatible, can be obtained from the advertising packet. This does not require connecting to the device. Also, the TX power value will vary depending on the power level, as the TX power value...

So it turns out that I was mistaken in thinking that this Slide animation handles the exit transition. The white flash happens because the old fragment is removed instantly and the new one slides in from the right side. To get the full animation I just did it the old...

Try adding <item name="android:windowTranslucentStatus">false</item> <item name="android:fitsSystemWindows">false</item> to either values/styles.xml or values-v21/styles.xml. When you define a style for a certain API level it will be applied not only to that version, but also to all higher versions, unless explicitly specified otherwise....

On Lollipop versions it's fine but it's not working at all when I deploy on a device with API lower than v21, I still see the black status bar and the primaryDark is totally ignored. Is it the right way? Your primary dark is ignored on all pre-lolipop devices...

As said, new design guidelines clearly state that dialogs should have clear and concise texts, to let the user take a fast decision. Having long long actions is thus discouraged. However, from Lollipop onward, a new design pattern has been allowed to accomodate larger texts. Take a look here and...

TranslationZ is a dynamic property used for animation. Basically it's needed to nicely handle elevation changes. When you press a button, its elevation remains unchanged and its translationZ is being animated. This way the View always knows what was the original elevation value and can respond correctly to multiple touch...

put your code from onCreate() to onStartCommand() because I think you are using startService() in onReceive() of your alarm receiver. and first time it create your service and call onCreate() but after 30 seconds when startService() get called then service is already created and hence it call onStartCommand(). @Override...

Finally got it working. It was due to this step had some problems before: $ sudo apt-get install bison g++-multilib git gperf libxml2-utils make zlib1g-dev:i386 zip From the messages it might be the g++-multilib was not installed properly. After making sure all the packages in the command got properly installed...

I would say JobScheduler is not a direct substitution for SyncAdapter, which has a much more specialized purpose (transferring data between the device and a server). JobScheduler, on the other hand, serves to schedule tasks to be executed at some point of time in future - just like AlarmManager -...

Recently I had same problem and found out below solution. mInteractive value would be "true" in dumpsys input_method for display ON and "false" for display OFF. Ex usage in shell script: screen_info=`adb shell dumpsys input_method | grep mInteractive=true` if [[ $screen_info == *"mInteractive"* ]] then echo "Screen is ON" #Do...

RippleDrawable responds to pressed and focused states, with the former giving the ripple animation that you're looking for. You can toggle pressed state on the host view using View.setPressed(boolean). Runnable pressRunnable = new Runnable() { @Override public void run() { button.setPressed(true); button.postOnAnimationDelayed(unpressRunnable, 250); } }; Runnable unpressRunnable = new Runnable()...

I ran into this issue recently after upgrading my targetApi from 20 to 22. I have a button with textColor: white, but it was showing transparent because my background color was transparent I am not sure why the textColor has issues on Lollipop, but I solved it by setting the...

Not since Lollipop. Starting with Android 5.0, the guidelines say: Notification icons must be entirely white. Even if they're not, the system will only consider the alpha channel of your icon, rendering them white Workaround The only way to have a coloured icon on Lollipop is to lower your targetSdkVersion...

When you use Android Studio, you generally use gradle build system, and gradle dependencies. In your project, you have you're root project build.gradle which is usualy tiny (~20 lines) and stay tiny. the second build.gradle is you're application gradle, the application you launch on you're device. This is the hierarchy...

I found solution. Black shape displays in action bar because one big-size logo.png was in folder "drawable". Logo must be in drawable-mdpi/hdpi/etc. in equal sizes (48dp/56dp height, depends on android version). I don't know why Android 5.0.1 on Galaxy S4 doesn't downsize the picture correct like emulators or real 4.4.2...

Lollipop introduced elevation as a way to position the elements on the Z axis and cast shadows between them depending on their difference of elevation. Enabled buttons have a default elevation of 2dp (and it increases when you press them). So, your button has a higher elevation than the FrameLayout...

you can refer this link to detect screen turn off Screen off Broadcast receiver and for killing the app you can use below code int pid = android.os.Process.myPid(); android.os.Process.killProcess(pid); ...

You can use android:background="?android:attr/selectableItemBackground" to get a rectangular ripple. Alternatively, you can create your own drawable. Here's the XML for the framework's selectable item background: drawable/item_background_material.xml: <ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="?android:attr/colorControlHighlight"> <item android:id="@android:id/mask"> <color android:color="@android:color/white" /> </item> </ripple> ...

TextInputLayout relies on resources/attributes in AppCompat. You need to use an AppCompat base theme. The AppCompat themes are a parent of the Material based themes on API 21+. So, you will be using the Material theme....

Apparently this was caused by Lux Dash app I had installed, that controls the brightness of the screen. Geesh. Took me a while to figure this out! I uninstalled it and the dimming came back. [Not a bug]

This is what finally solved the problem, along with simplifying properties, etc.: Hammer.defaults.stop_browser_behavior.touchAction = 'pan-y'; It was an issue with the hammer.js plugin with touchAction property. This affects some browsers - and apparently also Android 5 (but doesn't affect Android 4.* when using PhoneGap). Not as simple as it seems,...

The problem is not with your code but with the way android:adjustViewBounds work. This is documented in setAdjustViewBounds method of ImageView. Note:If the application targets API level 17 or lower, adjustViewBounds will allow the drawable to shrink the view bounds, but not grow to fill available measured space in all...

bellow the Solution in my case was (to add setDensity and to use the new BitmapDrawable that looks on Density). Hope it also helps u too. (btw. this 2 lines, did cost me 3 Days :) final Bitmap output = Bitmap.createBitmap(44, 65, Bitmap.Config.ARGB_8888); /*NEW -> */ output.setDensity(320); final Canvas canvas...

There should be something that you are looking for: https://bitbucket.org/brockoli/fragmentsharedelements/src/87421a65f2aaf5f99b0e48acbf4b31551e9118fc/app/src/main/java/com/brockoli/android/fragmentsharedelements/MyActivity.java?at=master

The OnImageAvailableListener.onImageAvailable callback is never called when a preview frame is available because the CaptureRequest which was sent to the CameraCaptureSession.setRepeatingRequest() method did not list the ImageReader's Surface as an output target. You identify what output Surfaces (raw byte buffers, essentially) you want the data of each capture to go...