Android 5, camera2 use only flash
https://github.com/pinguo-yuyidong/Camera2/blob/master/app/src/main/java/us/yydcdut/androidltest/otheractivity/FlashActivity.java here,you don’t need the preview to open the flash.
https://github.com/pinguo-yuyidong/Camera2/blob/master/app/src/main/java/us/yydcdut/androidltest/otheractivity/FlashActivity.java here,you don’t need the preview to open the flash.
Process of getting real Path from URI is same as before, but with a little addition: Uri uri = data.getData(); Uri docUri = DocumentsContract.buildDocumentUriUsingTree(uri, DocumentsContract.getTreeDocumentId(uri)); String path = getPath(this, docUri); The gist of getPath() method with intermediate methods can be found here: getPath()
Setting android:hardwareAccelerated=”false” is a kind of extreme solution, as graphical performance is likely to be very bad. If you can pinpoint the view that is misbehaving and causing this issue, a better fix would be to switch it to software rendering instead, via setLayerType(), e.g. view.setLayerType(View.LAYER_TYPE_SOFTWARE, null); Funny thing is, I haven’t experienced any rendering … Read more
Setting recyclerView parameters as below solved my stutter problem : recyclerView.setHasFixedSize(true); recyclerView.setItemViewCacheSize(20); recyclerView.setDrawingCacheEnabled(true); recyclerView.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_HIGH); i hope it helps someone else too.
Set these properties on your layout (if your layout has the default white/light background): android:clickable=”true” android:focusable=”true” android:background=”?attr/selectableItemBackground” You don’t need a custom drawable in this case. However, if your layout has a black/dark background, you’d have to create your own ripple drawable like this one: <?xml version=”1.0″ encoding=”utf-8″?> <!– An white rectangle ripple. –> <ripple … Read more
What you are looking for is: CardView card = … card.setCardBackgroundColor(color); In XML card_view:cardBackgroundColor=”@android:color/white” Update: in XML app:cardBackgroundColor=”@android:color/white”
The system statistics api evoked in your question is also presented here and the detailed API is here. As far as I can see this API won’t allow you to get the current top activity. i.e. you have the ability to receive UsageEvent with the type MOVE_TO_FOREGROUND by using UsageStatsManager.queryEvents but according javadoc : The … Read more
Here is the solution. Most of the layouts get solved by adding these properties in values-v21 style.xml <item name=”android:windowTranslucentStatus”>true</item> <item name=”android:windowTranslucentNavigation”>true</item> <item name=”android:fitsSystemWindows”>true</item> for others, I have calculated the hight of navigation bar and add margin to my view . public static int getSoftButtonsBarSizePort(Activity activity) { // getRealMetrics is only available with API 17 and … Read more
Recently there was a post here regarding the L SDK’s incompatibility with prior versions of Android. I’ve been digging in AOSP repositories for quite a few hours now, and determined that the tools behave this way because they are designed to treat preview platforms differently. If you compile against a preview SDK (android-L), the build … Read more
In your parseResponse() you are creating a new instance of the BusinessAdapter class, but you aren’t actually using it anywhere, so your RecyclerView doesn’t know the new instance exists. You either need to: Call recyclerView.setAdapter(mBusinessAdapter) again to update the RecyclerView’s adapter reference to point to your new one Or just remove mBusinessAdapter = new BusinessAdapter(mBusinesses); … Read more