ViewPager PagerAdapter not updating the View

There are several ways to achieve this. The first option is easier, but bit more inefficient. Override getItemPosition in your PagerAdapter like this:

This way, when you call notifyDataSetChanged(), the view pager will remove all views and reload them all. As so the reload effect is obtained. The second option, suggested by Alvaro Luis Bustamante (previously alvarolb), is to setTag()method in instantiateItem() when […]

person shubham sharmaaccess_time July 20, 2018launch Read More

Moving and resizing DrawerLayout’s content on sliding

You can do this by translating and scaling the content View in the onDrawerSlide() method of a DrawerListener on your DrawerLayout. Since the content View itself is resizing, and there’s a separate TextView that appears in the bottom right corner, we’ll stick both of these in another holder ViewGroup. If that label TextView isn’t needed, the holder ViewGroup can be omitted, as well. A basic DrawerLayout setup for the example:

  The […]

person shubham sharmaaccess_time June 6, 2018launch Read More

What are RecyclerView advantages compared to ListView?

With the advent of Android Lollipop, the RecyclerView made its way officially. The RecyclerView is much more powerful, flexible and a major enhancement over ListView. I will try to give you a detailed insight into it. Advantages 1) ViewHolder Pattern In a ListView, it was recommended to use the ViewHolder pattern but it was never a compulsion. In […]

person shubham sharmaaccess_time April 16, 2018launch Read More

Add/Include/inflate layout into a View Group

 

person shubham sharmaaccess_time December 28, 2017launch Read More

Create a Splash Screen with Video in Android

Splash Screen In this quick tutorial we will see how to implement a Video Splash Screen in your app. Splash Screens are normally shown for a few seconds as a progress while the app is ‘booting up’  i.e performing a version check or initialising the Analytics etc. Sometimes the Splash Screen is also used to showcase the app […]

person shubham sharmaaccess_time September 20, 2017launch Read More

Clear Cache in Android Application programmatically

If you are looking for delete cache of your own application then simply delete your cache directory and its all done !

  And you may require following permission to add in your manifest file in order to delete cache of other application

 

person shubham sharmaaccess_time May 25, 2017launch Read More

Service Thread IntentService AsyncTask

Android Thread Constructs(Part 4): Comparisons In this series of posts we have seen the following thread constructs: 1. Basic threads and communication between them [see article] 2. Understanding the Main thread or the UI thread [see article] 3. IntentService [see article] 4. AsyncTask [see article] NOTE:  These are Android specific constructs. Android also includes the […]

person shubham sharmaaccess_time May 19, 2017launch Read More

Fit image on top

 

person shubham sharmaaccess_time March 24, 2017launch Read More

How to solve java.lang.OutOfMemoryError trouble in Android

You can’t increase the heap size dynamically but you can request to use more by using. android:largeHeap=”true” in the manifest.xml,you can add in your manifest these lines it is working for some situations.

  Whether your application’s processes should be created with a large Dalvik heap. This applies to all processes created for the […]

person shubham sharmaaccess_time March 15, 2017launch Read More