ImageView in circular through XML

You can make a simple circle with white border and transparent content with shape. Then make a layerlist drawable and put it as background to your imageview. and put it as background to your imageview. You’ll have something like that.

Android Studio AVD – Emulator: Process finished with exit code 1

These are known errors from libGL and libstdc++ You can quick fix this by change to use Software for Emulated Performance Graphics option, in the AVD settings. Or try to use the libstdc++.so.6 (which is available in your system) instead of the one bundled inside Android SDK. There are 2 ways to replace it: The emulator has a switch -use-system-libs. You can found it here: ~/Android/Sdk/tools/emulator … Read more

IllegalStateException: Can not perform this action after onSaveInstanceState with ViewPager

Please check my answer here. Basically I just had to : Don’t make the call to super() on the saveInstanceState method. This was messing things up… This is a known bug in the support package. If you need to save the instance and add something to your outState Bundle you can use the following: In the end the proper solution was (as seen in the … Read more

findViewById in Fragment

Use getView() or the View parameter from implementing the onViewCreated method. It returns the root view for the fragment (the one returned by onCreateView() method). With this you can call findViewById(). As getView() works only after onCreateView(), you can’t use it inside onCreate() or onCreateView() methods of the fragment .