android-5.1.1-lollipop

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

﹥>﹥吖頭↗ 提交于 2019-11-26 17:18:47
问题 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);

Android getResources().getDrawable() deprecated API 22

我是研究僧i 提交于 2019-11-25 23:15:20
问题 With new android API 22 getResources().getDrawable() is now deprecated. Now the best approach is to use only getDrawable() . What changed? 回答1: You have some options to handle this deprecation the right (and future proof ) way, depending on which kind of drawable you are loading: A) drawables with theme attributes ContextCompat.getDrawable(getActivity(), R.drawable.name); You'll obtain a styled Drawable as your Activity theme instructs. This is probably what you need. B) drawables without