android-5.1.1-lollipop

CardView elevation not working on Android 5.1.1

非 Y 不嫁゛ 提交于 2019-11-30 10:35:36
I am using CardView inside a RecyclerView. After reading a lot I ended up with following 'NOT WORKING' code only on Android 5.1.1. On Android Version prior to this one its working nice. <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:card_view="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#11ffffff" android:orientation="vertical" android:paddingBottom="10dp"> <RelativeLayout android:layout_width="match_parent" android:layout_height=

CardView elevation not working on Android 5.1.1

て烟熏妆下的殇ゞ 提交于 2019-11-29 15:46:00
问题 I am using CardView inside a RecyclerView. After reading a lot I ended up with following 'NOT WORKING' code only on Android 5.1.1. On Android Version prior to this one its working nice. <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:card_view="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#11ffffff" android:orientation="vertical"

AlarmManager not working on Samsung devices in Lollipop

烂漫一生 提交于 2019-11-29 09:42:58
问题 I develop an app that uses AlarmManager to set a bunch alarms (usually around 50) that need to be fired at a certain time during the year. This is the code I'm using since 4.4 kitkat changed the AlarmManager. AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE); long setDate = fireDate.getTime(); // it's a calendar date defined above Intent intent = new Intent(LOCAL_DISPLAY_MESSAGE_ACTION); PendingIntent pending = PendingIntent.getBroadcast(ctx, id, intent, PendingIntent.FLAG

How to prevent BluetoothGattCallback from being executed multiple times at a time

别等时光非礼了梦想. 提交于 2019-11-29 05:07:29
I have a service that has one instance of BluetoothGattCallback public class MyService extends Service { private BluetoothGattCallback callback; @Override public void onCreate() { super.onCreate(); callback = new BluetoothGattCallback() { @Override public synchronized void onConnectionStateChange(BluetoothGatt gatt, int status, int newState) { Log.i("onConnectionStateChanged", "Status " + status); Log.i("onConnectionStateChanged", "New State " + newState); } }; } // registration of bluetooth adapter and blah blah blah } When I start the app, it works fine and the callback only gets called once

Android XML: android:elevation vs. app:elevation

痴心易碎 提交于 2019-11-29 02:56:00
When do I use android:elevation and when app:elevation ? What's the difference between those two? Hope I can help, Let's talk with an example: <android.support.design.widget.FloatingActionButton android:layout_height="wrap_content" android:layout_width="wrap_content" ... android:elevation="@dimen/elevation_medium" /> The android:elevation attribute will work from the API level 21 and upper. <android.support.design.widget.FloatingActionButton android:layout_height="wrap_content" android:layout_width="wrap_content" ... app:elevation="@dimen/elevation_medium" /> In this case the app:elevation

Android Webview gives net::ERR_CACHE_MISS message

 ̄綄美尐妖づ 提交于 2019-11-27 18:54:24
I built a web app and wants to create an android app that has a webview that shows my web app. After following the instructions from Google Developer to create an app, I successfully installed it on my phone with Android 5.1.1. However, when I run the app for the first time, the webview shows the message: Web page not available The Web page at http://www.google.com.sg could not be loaded as: net::ERR_CACHE_MISS After searching for a while on Google and trying out solutions, I am still stuck on this error. I have included all permissions needed so it shouldn't be beacuse of that. My Android

How to prevent BluetoothGattCallback from being executed multiple times at a time

梦想与她 提交于 2019-11-27 18:42:38
问题 I have a service that has one instance of BluetoothGattCallback public class MyService extends Service { private BluetoothGattCallback callback; @Override public void onCreate() { super.onCreate(); callback = new BluetoothGattCallback() { @Override public synchronized void onConnectionStateChange(BluetoothGatt gatt, int status, int newState) { Log.i("onConnectionStateChanged", "Status " + status); Log.i("onConnectionStateChanged", "New State " + newState); } }; } // registration of bluetooth

Android XML: android:elevation vs. app:elevation

南楼画角 提交于 2019-11-27 17:26:35
问题 When do I use android:elevation and when app:elevation ? What's the difference between those two? 回答1: Hope I can help, Let's talk with an example: <android.support.design.widget.FloatingActionButton android:layout_height="wrap_content" android:layout_width="wrap_content" ... android:elevation="@dimen/elevation_medium" /> The android:elevation attribute will work from the API level 21 and upper. <android.support.design.widget.FloatingActionButton android:layout_height="wrap_content" android

How to delete particular inbox message in Android version 5.0 lollipop or in Kitkat?

末鹿安然 提交于 2019-11-27 15:50:46
I am making to delete particular sms of phone number task. when I am testing in motog or Android version 5.0's mobile. I can't delete particular number's sms. My code snippet is below. public void deleteSMS(Context context,String number) { try { Log.d("","Deleting SMS from inbox"); Uri uriSms = Uri.parse("content://sms/inbox"); Cursor c = context.getContentResolver().query(uriSms, new String[] { "_id", "thread_id", "address", "person", "date", "body" }, "address = '"+number+"'", null, null); if (c != null && c.moveToFirst()) { do { long id = c.getLong(0); long threadId = c.getLong(1); String

Android Webview gives net::ERR_CACHE_MISS message

。_饼干妹妹 提交于 2019-11-26 19:39:13
问题 I built a web app and wants to create an android app that has a webview that shows my web app. After following the instructions from Google Developer to create an app, I successfully installed it on my phone with Android 5.1.1. However, when I run the app for the first time, the webview shows the message: Web page not available The Web page at http://www.google.com.sg could not be loaded as: net::ERR_CACHE_MISS After searching for a while on Google and trying out solutions, I am still stuck